diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-18 21:44:57 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-18 21:44:57 +0000 |
commit | bce64c2a24fb4484b18813bef367dcc71e8a0dd0 (patch) | |
tree | dfc7f71507d6c603255802772ca128609460ca08 /sys/arch/i386 | |
parent | fd1b35e57ce1fdce5ec1dc979ff36b7649cab0c5 (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/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/linux_machdep.c | 14 | ||||
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 14 | ||||
-rw-r--r-- | sys/arch/i386/i386/svr4_machdep.c | 18 | ||||
-rw-r--r-- | sys/arch/i386/i386/vm86.c | 4 |
4 files changed, 26 insertions, 24 deletions
diff --git a/sys/arch/i386/i386/linux_machdep.c b/sys/arch/i386/i386/linux_machdep.c index 63694f4fea5..1363e747c50 100644 --- a/sys/arch/i386/i386/linux_machdep.c +++ b/sys/arch/i386/i386/linux_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_machdep.c,v 1.38 2011/04/15 04:52:39 guenther Exp $ */ +/* $OpenBSD: linux_machdep.c,v 1.39 2011/04/18 21:44:55 guenther Exp $ */ /* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */ /* @@ -114,16 +114,16 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code, int type, int oonstack; tf = p->p_md.md_regs; - oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; + oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; /* * Allocate space for the signal handler context. */ - if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && + if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct linux_sigframe *)((char *)p->p_sigstk.ss_sp + - p->p_sigstk.ss_size - sizeof(struct linux_sigframe)); - p->p_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct linux_sigframe *)((char *)psp->ps_sigstk.ss_sp + + psp->ps_sigstk.ss_size - sizeof(struct linux_sigframe)); + psp->ps_sigstk.ss_flags |= SS_ONSTACK; } else { fp = (struct linux_sigframe *)tf->tf_esp - 1; } @@ -257,7 +257,7 @@ linux_sys_sigreturn(struct proc *p, void *v, register_t *retval) tf->tf_esp = context.sc_esp_at_signal; tf->tf_ss = context.sc_ss; - p->p_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = context.sc_mask & ~sigcantmask; return (EJUSTRETURN); diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 0700d4fdc87..86706325691 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.491 2011/04/16 00:40:58 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.492 2011/04/18 21:44:55 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -2189,7 +2189,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, struct sigframe *fp, frame; struct sigacts *psp = p->p_sigacts; register_t sp; - int oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; + int oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; /* * Build the argument list for the signal handler. @@ -2199,10 +2199,10 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, /* * Allocate space for the signal handler context. */ - if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && + if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - sp = (long)p->p_sigstk.ss_sp + p->p_sigstk.ss_size; - p->p_sigstk.ss_flags |= SS_ONSTACK; + sp = (long)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size; + psp->ps_sigstk.ss_flags |= SS_ONSTACK; } else sp = tf->tf_esp; @@ -2377,9 +2377,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) } if (context.sc_onstack & 01) - p->p_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = context.sc_mask & ~sigcantmask; return (EJUSTRETURN); diff --git a/sys/arch/i386/i386/svr4_machdep.c b/sys/arch/i386/i386/svr4_machdep.c index 80a363e5f50..dd53247a300 100644 --- a/sys/arch/i386/i386/svr4_machdep.c +++ b/sys/arch/i386/i386/svr4_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_machdep.c,v 1.28 2011/04/15 10:03:44 claudio Exp $ */ +/* $OpenBSD: svr4_machdep.c,v 1.29 2011/04/18 21:44:55 guenther Exp $ */ /* $NetBSD: svr4_machdep.c,v 1.24 1996/05/03 19:42:26 christos Exp $ */ /* @@ -63,9 +63,10 @@ svr4_getcontext(struct proc *p, struct svr4_ucontext *uc, int mask, int oonstack) { struct trapframe *tf = p->p_md.md_regs; + struct sigacts *psp = p->p_sigacts; svr4_greg_t *r = uc->uc_mcontext.greg; struct svr4_sigaltstack *s = &uc->uc_stack; - struct sigaltstack *sf = &p->p_sigstk; + struct sigaltstack *sf = &psp->ps_sigstk; bzero(uc, sizeof(struct svr4_ucontext)); @@ -133,10 +134,11 @@ svr4_getcontext(struct proc *p, struct svr4_ucontext *uc, int mask, int svr4_setcontext(struct proc *p, struct svr4_ucontext *uc) { + struct sigacts *psp = p->p_sigacts; struct trapframe *tf; svr4_greg_t *r = uc->uc_mcontext.greg; struct svr4_sigaltstack *s = &uc->uc_stack; - struct sigaltstack *sf = &p->p_sigstk; + struct sigaltstack *sf = &psp->ps_sigstk; int mask; /* @@ -314,16 +316,16 @@ svr4_sendsig(sig_t catcher, int sig, int mask, u_long code, int type, int oonstack; tf = p->p_md.md_regs; - oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; + oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; /* * Allocate space for the signal handler context. */ - if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && + if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct svr4_sigframe *)((char *)p->p_sigstk.ss_sp + - p->p_sigstk.ss_size - sizeof(struct svr4_sigframe)); - p->p_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct svr4_sigframe *)((char *)psp->ps_sigstk.ss_sp + + psp->ps_sigstk.ss_size - sizeof(struct svr4_sigframe)); + psp->ps_sigstk.ss_flags |= SS_ONSTACK; } else { fp = (struct svr4_sigframe *)tf->tf_esp - 1; } diff --git a/sys/arch/i386/i386/vm86.c b/sys/arch/i386/i386/vm86.c index 8c2b1aca73e..4ca36573bf4 100644 --- a/sys/arch/i386/i386/vm86.c +++ b/sys/arch/i386/i386/vm86.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm86.c,v 1.19 2011/04/15 04:52:39 guenther Exp $ */ +/* $OpenBSD: vm86.c,v 1.20 2011/04/18 21:44:55 guenther Exp $ */ /* $NetBSD: vm86.c,v 1.15 1996/05/03 19:42:33 christos Exp $ */ /*- @@ -427,7 +427,7 @@ i386_vm86(struct proc *p, char *args, register_t *retval) #undef DOREG /* Going into vm86 mode jumps off the signal stack. */ - p->p_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; set_vflags(p, vm86s.regs.vmsc.sc_eflags | PSL_VM); |