From: Eric W. Biederman Date: Sat, 8 Jan 2022 15:34:50 +0000 (-0600) Subject: signal: Have prepare_signal detect coredumps using signal->core_state X-Git-Tag: v6.1-rc5~2203^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0287db0f1d6918919203ba31fd7cda59bf889e8;p=platform%2Fkernel%2Flinux-starfive.git signal: Have prepare_signal detect coredumps using signal->core_state In preparation for removing the flag SIGNAL_GROUP_COREDUMP, change prepare_signal to test signal->core_state instead of the flag SIGNAL_GROUP_COREDUMP. Both fields are protected by siglock and both live in signal_struct so there are no real tradeoffs here, just a change to which field is being tested. Link: https://lkml.kernel.org/r/20211213225350.27481-1-ebiederm@xmission.com Link: https://lkml.kernel.org/r/875yqu14co.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" --- diff --git a/kernel/signal.c b/kernel/signal.c index 8272cac..f95a442 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -906,8 +906,8 @@ static bool prepare_signal(int sig, struct task_struct *p, bool force) struct task_struct *t; sigset_t flush; - if (signal->flags & (SIGNAL_GROUP_EXIT | SIGNAL_GROUP_COREDUMP)) { - if (!(signal->flags & SIGNAL_GROUP_EXIT)) + if ((signal->flags & SIGNAL_GROUP_EXIT) || signal->core_state) { + if (signal->core_state) return sig == SIGKILL; /* * The process is in the middle of dying, nothing to do.