diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_ktrace.h" + #include #include #include @@ -542,6 +544,8 @@ rk = data; sx_assert(&proctree_lock, SX_LOCKED); + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SIGNAL, &rk->rk_sig); if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); if (rk->rk_sig <= 0 || rk->rk_sig > _SIG_MAXSIG || diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1906,8 +1906,12 @@ * The main rationale behind this is that abort(3) is implemented as * kill(getpid(), SIGABRT). */ - if (IN_CAPABILITY_MODE(td) && pid != td->td_proc->p_pid) - return (ECAPMODE); + if (pid != td->td_proc->p_pid) { + if (CAP_TRACING(td)) + ktrcapfail(CAPFAIL_SIGNAL, &signum); + if (IN_CAPABILITY_MODE(td)) + return (ECAPMODE); + } AUDIT_ARG_SIGNUM(signum); AUDIT_ARG_PID(pid);