kernel/signal.c: simplify force_sig_info_to_task(), kill recalc_sigpending_and_wake()
authorOleg Nesterov <oleg@redhat.com>
Mon, 20 Nov 2023 15:16:49 +0000 (16:16 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 11 Dec 2023 01:21:32 +0000 (17:21 -0800)
commitb454ec29225cda9ae85ed0a154f4228f1922c872
tree52f79ef72a364a591ecbc3bf997b07b3754948d1
parent48aa137e5a9491b491ae2bea0e0a603b330e708f
kernel/signal.c: simplify force_sig_info_to_task(), kill recalc_sigpending_and_wake()

The purpose of recalc_sigpending_and_wake() is not clear, it looks
"obviously unneeded" because we are going to send the signal which can't
be blocked or ignored.

Add the comment to explain why we can't rely on send_signal_locked() and
make this logic more simple/explicit.  recalc_sigpending_and_wake() has no
other users, it can die.

In fact I think we don't even need signal_wake_up(), the target task must
be either current or a TASK_TRACED child, otherwise the usage of siglock
is not safe.  But this needs another change.

Link: https://lkml.kernel.org/r/20231120151649.GA15995@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/sched/signal.h
kernel/signal.c