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.
This commit is contained in:
martin 2011-03-03 20:46:16 +00:00
parent 80dcd7f76f
commit ccc5092ed2
1 changed files with 15 additions and 13 deletions

View File

@ -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 @@ kill1(struct lwp *l, pid_t pid, ksiginfo_t *ksi, register_t *retval)
if ((u_int)ksi->ksi_signo >= NSIG)
return EINVAL;
if (ksi->ksi_pid != l->l_proc->p_pid)
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;
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;
switch (ksi->ksi_code) {
case SI_USER:
case SI_QUEUE:
break;
default:
return EPERM;
}
}
if (pid > 0) {
/* kill single process */
mutex_enter(proc_lock);