Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_sig.c
Show First 20 Lines • Show All 1,900 Lines • ▼ Show 20 Lines | kern_kill(struct thread *td, pid_t pid, int signum) | ||||
struct proc *p; | struct proc *p; | ||||
int error; | int error; | ||||
/* | /* | ||||
* A process in capability mode can send signals only to himself. | * A process in capability mode can send signals only to himself. | ||||
* The main rationale behind this is that abort(3) is implemented as | * The main rationale behind this is that abort(3) is implemented as | ||||
* kill(getpid(), SIGABRT). | * kill(getpid(), SIGABRT). | ||||
*/ | */ | ||||
if (IN_CAPABILITY_MODE(td) && pid != td->td_proc->p_pid) | if (pid != td->td_proc->p_pid) { | ||||
if (CAP_TRACING(td)) | |||||
ktrcapfail(CAPFAIL_SIGNAL, &signum); | |||||
if (IN_CAPABILITY_MODE(td)) | |||||
return (ECAPMODE); | return (ECAPMODE); | ||||
} | |||||
AUDIT_ARG_SIGNUM(signum); | AUDIT_ARG_SIGNUM(signum); | ||||
AUDIT_ARG_PID(pid); | AUDIT_ARG_PID(pid); | ||||
if ((u_int)signum > _SIG_MAXSIG) | if ((u_int)signum > _SIG_MAXSIG) | ||||
return (EINVAL); | return (EINVAL); | ||||
ksiginfo_init(&ksi); | ksiginfo_init(&ksi); | ||||
ksi.ksi_signo = signum; | ksi.ksi_signo = signum; | ||||
▲ Show 20 Lines • Show All 2,683 Lines • Show Last 20 Lines |