Module Name:    src
Committed By:   christos
Date:           Fri Feb 14 16:35:11 UTC 2014

Modified Files:
        src/sys/kern: sys_sig.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/kern/sys_sig.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_sig.c
diff -u src/sys/kern/sys_sig.c:1.41 src/sys/kern/sys_sig.c:1.42
--- src/sys/kern/sys_sig.c:1.41	Fri Mar  8 04:32:59 2013
+++ src/sys/kern/sys_sig.c	Fri Feb 14 11:35:11 2014
@@ -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 @@ sigaction1(struct lwp *l, int signum, co
 	 * 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;

Reply via email to