Module Name: src Committed By: martin Date: Thu Mar 3 20:46:16 UTC 2011
Modified Files: src/sys/kern: sys_sig.c Log Message: Do not restrict the siginfo a process sends to itself in any way, but keep restrictions for foreign processes. This is needed to allow raising of full SIGFPE siginfo from softfloat libraries for example. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 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.31 src/sys/kern/sys_sig.c:1.32 --- src/sys/kern/sys_sig.c:1.31 Thu Feb 3 21:45:32 2011 +++ src/sys/kern/sys_sig.c Thu Mar 3 20:46:16 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_sig.c,v 1.31 2011/02/03 21:45:32 joerg Exp $ */ +/* $NetBSD: sys_sig.c,v 1.32 2011/03/03 20:46:16 martin 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.31 2011/02/03 21:45:32 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.32 2011/03/03 20:46:16 martin Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -223,20 +223,22 @@ if ((u_int)ksi->ksi_signo >= NSIG) return EINVAL; - if (ksi->ksi_pid != l->l_proc->p_pid) - return EPERM; - - if (ksi->ksi_uid != kauth_cred_geteuid(l->l_cred)) - return EPERM; - - switch (ksi->ksi_code) { - case SI_USER: - case SI_QUEUE: - break; - default: - return EPERM; + if (pid != l->l_proc->p_pid) { + if (ksi->ksi_pid != l->l_proc->p_pid) + return EPERM; + + if (ksi->ksi_uid != kauth_cred_geteuid(l->l_cred)) + return EPERM; + + switch (ksi->ksi_code) { + case SI_USER: + case SI_QUEUE: + break; + default: + return EPERM; + } } - + if (pid > 0) { /* kill single process */ mutex_enter(proc_lock);