Fix thinko in last thinko fix. We always have to store an old style

signal mask since a 1.3 binary may attempt to invoke sigreturn(2) directly
for an alternate exit from the signal handler.  If we don't do this, it will
get a garbage signal mask if it tries to do that.
This commit is contained in:
thorpej 1998-09-13 01:45:04 +00:00
parent 7f361cc70c
commit 6351312ff7
2 changed files with 13 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.321 1998/09/12 10:48:28 mycroft Exp $ */
/* $NetBSD: machdep.c,v 1.322 1998/09/13 01:45:04 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -1093,10 +1093,6 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
/* NOTREACHED */
}
#ifdef COMPAT_13
void native_sigset_to_sigset13 __P((const sigset_t *, sigset13_t *));
#endif
/*
* Send an interrupt to process.
*
@ -1178,6 +1174,16 @@ sendsig(catcher, sig, mask, code)
/* Save signal mask. */
frame.sf_sc.sc_mask = *mask;
#ifdef COMPAT_13
/*
* XXX We always have to save an old style signal mask because
* XXX we might be delivering a signal to a process which will
* XXX escape from the signal in a non-standard way and invoke
* XXX sigreturn() directly.
*/
native_sigset_to_sigset13(mask, &frame.sf_sc.__sc_mask13);
#endif
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
* Process has trashed its stack; give it an illegal

View File

@ -1,4 +1,4 @@
/* $NetBSD: signal.h,v 1.10 1998/09/12 10:48:28 mycroft Exp $ */
/* $NetBSD: signal.h,v 1.11 1998/09/13 01:45:04 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@ -102,7 +102,7 @@ struct sigcontext {
int sc_ss;
int sc_onstack; /* sigstack state to restore */
int __sc_unused;
sigset13_t __sc_mask13; /* signal mask to restore (old style) */
int sc_trapno; /* XXX should be above */
int sc_err;