Module Name: src
Committed By: christos
Date: Fri Jan 24 22:10:48 UTC 2014
Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_signal.c
Log Message:
sigaction until 1.4 had an int sigmask, don't trash the stack.
To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/netbsd32/netbsd32_signal.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.97 src/sys/compat/netbsd32/netbsd32.h:1.98
--- src/sys/compat/netbsd32/netbsd32.h:1.97 Wed Jan 1 13:57:16 2014
+++ src/sys/compat/netbsd32/netbsd32.h Fri Jan 24 17:10:47 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32.h,v 1.97 2014/01/01 18:57:16 dsl Exp $ */
+/* $NetBSD: netbsd32.h,v 1.98 2014/01/24 22:10:47 christos Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -48,6 +48,7 @@
#include <sys/ucred.h>
#include <compat/sys/ucontext.h>
#include <compat/sys/mount.h>
+#include <compat/sys/signal.h>
/*
* first, define the basic types we need.
@@ -586,6 +587,12 @@ struct netbsd32_shmid_ds14 {
/* from <sys/signal.h> */
typedef netbsd32_pointer_t netbsd32_sigsetp_t;
typedef netbsd32_pointer_t netbsd32_sigactionp_t;
+struct netbsd32_sigaction13 {
+ netbsd32_voidp netbsd32_sa_handler; /* signal handler */
+ sigset13_t netbsd32_sa_mask; /* signal mask to apply */
+ int netbsd32_sa_flags; /* see signal options below */
+};
+
struct netbsd32_sigaction {
netbsd32_voidp netbsd32_sa_handler; /* signal handler */
sigset_t netbsd32_sa_mask; /* signal mask to apply */
Index: src/sys/compat/netbsd32/netbsd32_signal.c
diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.37 src/sys/compat/netbsd32/netbsd32_signal.c:1.38
--- src/sys/compat/netbsd32/netbsd32_signal.c:1.37 Sun Feb 19 16:06:41 2012
+++ src/sys/compat/netbsd32/netbsd32_signal.c Fri Jan 24 17:10:47 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_signal.c,v 1.37 2012/02/19 21:06:41 rmind Exp $ */
+/* $NetBSD: netbsd32_signal.c,v 1.38 2014/01/24 22:10:47 christos Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.37 2012/02/19 21:06:41 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.38 2014/01/24 22:10:47 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -65,7 +65,7 @@ netbsd32_sigaction(struct lwp *l, const
syscallarg(netbsd32_sigactionp_t) osa;
} */
struct sigaction nsa, osa;
- struct netbsd32_sigaction *sa32p, sa32;
+ struct netbsd32_sigaction13 *sa32p, sa32;
int error;
if (SCARG_P32(uap, nsa)) {
@@ -73,7 +73,8 @@ netbsd32_sigaction(struct lwp *l, const
if (copyin(sa32p, &sa32, sizeof(sa32)))
return EFAULT;
nsa.sa_handler = (void *)NETBSD32PTR64(sa32.netbsd32_sa_handler);
- nsa.sa_mask = sa32.netbsd32_sa_mask;
+ memset(&nsa.sa_mask, 0, sizeof(nsa.sa_mask));
+ nsa.sa_mask.__bits[0] = sa32.netbsd32_sa_mask;
nsa.sa_flags = sa32.netbsd32_sa_flags;
}
error = sigaction1(l, SCARG(uap, signum),
@@ -86,7 +87,7 @@ netbsd32_sigaction(struct lwp *l, const
if (SCARG_P32(uap, osa)) {
NETBSD32PTR32(sa32.netbsd32_sa_handler, osa.sa_handler);
- sa32.netbsd32_sa_mask = osa.sa_mask;
+ sa32.netbsd32_sa_mask = osa.sa_mask.__bits[0];
sa32.netbsd32_sa_flags = osa.sa_flags;
sa32p = SCARG_P32(uap, osa);
if (copyout(&sa32, sa32p, sizeof(sa32)))