summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2011-04-18 21:44:57 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2011-04-18 21:44:57 +0000
commitbce64c2a24fb4484b18813bef367dcc71e8a0dd0 (patch)
treedfc7f71507d6c603255802772ca128609460ca08 /sys/compat
parentfd1b35e57ce1fdce5ec1dc979ff36b7649cab0c5 (diff)
Revert the sigacts diff: NFS can apparently retain pointers to processes
until they're zombies and then send them signals (for intr mounts). Until that is untangled, the sigacts change is unsafe. sthen@ was the victim for this one
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/common/kern_sig_43.c31
-rw-r--r--sys/compat/svr4/svr4_signal.c4
2 files changed, 17 insertions, 18 deletions
diff --git a/sys/compat/common/kern_sig_43.c b/sys/compat/common/kern_sig_43.c
index baaa833735e..83892a75350 100644
--- a/sys/compat/common/kern_sig_43.c
+++ b/sys/compat/common/kern_sig_43.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig_43.c,v 1.10 2011/04/15 04:52:40 guenther Exp $ */
+/* $OpenBSD: kern_sig_43.c,v 1.11 2011/04/18 21:44:56 guenther Exp $ */
/* $NetBSD: kern_sig_43.c,v 1.7 1996/03/14 19:31:47 christos Exp $ */
/*
@@ -112,26 +112,25 @@ compat_43_sys_sigstack(p, v, retval)
syscallarg(struct sigstack *) oss;
} */ *uap = v;
struct sigstack ss;
+ struct sigacts *psp;
int error = 0;
- if (SCARG(uap, oss)) {
- ss.ss_sp = p->p_sigstk.ss_sp;
- ss.ss_onstack = p->p_sigstk.ss_flags & SS_ONSTACK;
- if ((error = copyout(&ss, SCARG(uap, oss), sizeof(ss))))
- return (error);
- }
+ psp = p->p_sigacts;
+ ss.ss_sp = psp->ps_sigstk.ss_sp;
+ ss.ss_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
+ if (SCARG(uap, oss) && (error = copyout((caddr_t)&ss,
+ (caddr_t)SCARG(uap, oss), sizeof (struct sigstack))))
+ return (error);
if (SCARG(uap, nss) == 0)
return (0);
- error = copyin(SCARG(uap, nss), &ss, sizeof(ss));
+ error = copyin((caddr_t)SCARG(uap, nss), (caddr_t)&ss,
+ sizeof (ss));
if (error)
return (error);
- if (p->p_sigstk.ss_flags & SS_ONSTACK)
- return (EPERM);
- if (ss.ss_onstack)
- return (EINVAL);
- p->p_sigstk.ss_sp = ss.ss_sp;
- p->p_sigstk.ss_size = 0;
- p->p_sigstk.ss_flags = 0;
+ psp->ps_flags |= SAS_ALTSTACK;
+ psp->ps_sigstk.ss_sp = ss.ss_sp;
+ psp->ps_sigstk.ss_size = 0;
+ psp->ps_sigstk.ss_flags |= ss.ss_onstack & SS_ONSTACK;
return (0);
}
@@ -172,7 +171,7 @@ compat_43_sys_sigvec(p, v, retval)
sv->sv_flags |= SV_INTERRUPT;
if ((ps->ps_sigreset & bit) != 0)
sv->sv_flags |= SV_RESETHAND;
- if (ps->ps_flags & SAS_NOCLDSTOP)
+ if (p->p_flag & P_NOCLDSTOP)
sv->sv_flags |= SA_NOCLDSTOP;
sv->sv_mask &= ~bit;
error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, osv),
diff --git a/sys/compat/svr4/svr4_signal.c b/sys/compat/svr4/svr4_signal.c
index 2b30b0144b2..b66f912912e 100644
--- a/sys/compat/svr4/svr4_signal.c
+++ b/sys/compat/svr4/svr4_signal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_signal.c,v 1.13 2011/04/15 04:52:40 guenther Exp $ */
+/* $OpenBSD: svr4_signal.c,v 1.14 2011/04/18 21:44:56 guenther Exp $ */
/* $NetBSD: svr4_signal.c,v 1.24 1996/12/06 03:21:53 christos Exp $ */
/*
@@ -650,7 +650,7 @@ svr4_sys_context(p, v, retval)
case 0:
DPRINTF(("getcontext(%p)\n", SCARG(uap, uc)));
svr4_getcontext(p, &uc, p->p_sigmask,
- p->p_sigstk.ss_flags & SS_ONSTACK);
+ p->p_sigacts->ps_sigstk.ss_flags & SS_ONSTACK);
return copyout(&uc, SCARG(uap, uc), sizeof(uc));
case 1: