Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Don't check trampolines for SIG_DFL or SIG_IGN sinc...



details:   https://anonhg.NetBSD.org/src/rev/6cd50cbf121f
branches:  trunk
changeset: 326715:6cd50cbf121f
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 14 16:35:11 2014 +0000

description:
Don't check trampolines for SIG_DFL or SIG_IGN since they are not used.
>From gimpy.

diffstat:

 sys/kern/sys_sig.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 3240634ebdc8 -r 6cd50cbf121f sys/kern/sys_sig.c
--- a/sys/kern/sys_sig.c        Fri Feb 14 16:04:44 2014 +0000
+++ b/sys/kern/sys_sig.c        Fri Feb 14 16:35:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_sig.c,v 1.41 2013/03/08 09:32:59 apb Exp $ */
+/*     $NetBSD: sys_sig.c,v 1.42 2014/02/14 16:35:11 christos Exp $    */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.41 2013/03/08 09:32:59 apb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.42 2014/02/14 16:35:11 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -389,16 +389,18 @@
         * 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. Emulations use legacy
-        * kernel trampolines with version 0, alternatively check for that
-        * too.
+        * vers if a new sigaction was supplied and there was an actual
+        * handler specified (not SIG_IGN or SIG_DFL), which don't require
+        * a trampoline. Emulations use legacy kernel trampolines with
+        * version 0, alternatively check for that too.
         *
         * If version < 2, we try to autoload the compat module.  Note
         * that we interlock with the unload check in compat_modcmd()
         * using kernconfig_lock.  If the autoload fails, we don't try it
         * again for this process.
         */
-       if (nsa != NULL) {
+       if (nsa != NULL && nsa->sa_handler != SIG_IGN
+           && nsa->sa_handler != SIG_DFL) {
                if (__predict_false(vers < 2)) {
                        if (p->p_flag & PK_32)
                                v0v1valid = true;



Home | Main Index | Thread Index | Old Index