Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

signal: HANDLER_EXIT should clear SIGNAL_UNKILLABLE

Fatal SIGSYS signals (i.e. seccomp RET_KILL_* syscall filter actions)
were not being delivered to ptraced pid namespace init processes. Make
sure the SIGNAL_UNKILLABLE doesn't get set for these cases.

Reported-by: Robert Święcki <robert@swiecki.net>
Suggested-by: "Eric W. Biederman" <ebiederm@xmission.com>
Fixes: 00b06da29cf9 ("signal: Add SA_IMMUTABLE to ensure forced siganls do not get changed")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Link: https://lore.kernel.org/lkml/878rui8u4a.fsf@email.froward.int.ebiederm.org

+3 -2
+3 -2
kernel/signal.c
··· 1342 1342 } 1343 1343 /* 1344 1344 * Don't clear SIGNAL_UNKILLABLE for traced tasks, users won't expect 1345 - * debugging to leave init killable. 1345 + * debugging to leave init killable. But HANDLER_EXIT is always fatal. 1346 1346 */ 1347 - if (action->sa.sa_handler == SIG_DFL && !t->ptrace) 1347 + if (action->sa.sa_handler == SIG_DFL && 1348 + (!t->ptrace || (handler == HANDLER_EXIT))) 1348 1349 t->signal->flags &= ~SIGNAL_UNKILLABLE; 1349 1350 ret = send_signal(sig, info, t, PIDTYPE_PID); 1350 1351 spin_unlock_irqrestore(&t->sighand->siglock, flags);