signal/seccomp: Refactor seccomp signal and coredump generation
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 23 Jun 2021 21:44:32 +0000 (16:44 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 26 Aug 2021 15:30:12 +0000 (10:30 -0500)
commit307d522f5eb86cd6ac8c905f5b0577dedac54ec5
tree826a8de8128133767b650120882b4edea7ee728b
parenta3616a3c02722d1edb95acc7fceade242f6553ba
signal/seccomp: Refactor seccomp signal and coredump generation

Factor out force_sig_seccomp from the seccomp signal generation and
place it in kernel/signal.c.  The function force_sig_seccomp takes a
parameter force_coredump to indicate that the sigaction field should
be reset to SIGDFL so that a coredump will be generated when the
signal is delivered.

force_sig_seccomp is then used to replace both seccomp_send_sigsys
and seccomp_init_siginfo.

force_sig_info_to_task gains an extra parameter to force using
the default signal action.

With this change seccomp is no longer a special case and there
becomes exactly one place do_coredump is called from.

Further it no longer becomes necessary for __seccomp_filter
to call do_group_exit.

Acked-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/87r1gr6qc4.fsf_-_@disp2133
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
include/linux/sched/signal.h
kernel/seccomp.c
kernel/signal.c