Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Fix problem with signal trampoline version checking...



details:   https://anonhg.NetBSD.org/src/rev/b3533fe4478c
branches:  trunk
changeset: 552813:b3533fe4478c
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Oct 03 17:51:13 2003 +0000

description:
Fix problem with signal trampoline version checking that did not take into
account that emulations usually use version 0 and provide their own in kernel
trampolines.

diffstat:

 sys/kern/kern_sig.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r c7ab7baee623 -r b3533fe4478c sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Fri Oct 03 16:48:55 2003 +0000
+++ b/sys/kern/kern_sig.c       Fri Oct 03 17:51:13 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig.c,v 1.162 2003/09/27 00:57:45 matt Exp $      */
+/*     $NetBSD: kern_sig.c,v 1.163 2003/10/03 17:51:13 christos Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.162 2003/09/27 00:57:45 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.163 2003/10/03 17:51:13 christos Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_compat_sunos.h"
@@ -275,11 +275,16 @@
         * Trampoline ABI version 0 is reserved for the legacy
         * kernel-provided on-stack trampoline.  Conversely, if we are
         * using a non-0 ABI version, we must have a trampoline.  Only
-        * validate the vers if a new sigaction was supplied.
+        * validate the vers if a new sigaction was supplied. Emulations
+        * use legacy kernel trampolines with version 0, alternatively
+        * check for that too.
         */
        if ((vers != 0 && tramp == NULL) ||
 #ifdef SIGTRAMP_VALID
-           (nsa != NULL && !SIGTRAMP_VALID(vers)) ||
+           (nsa != NULL && 
+           ((vers == 0) ? 
+               (p->p_emul->e_sigcode == NULL) :
+               !SIGTRAMP_VALID(vers))) ||
 #endif
            (vers == 0 && tramp != NULL))
                return (EINVAL);



Home | Main Index | Thread Index | Old Index