]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
do_notify_parent: sanitize the valid_signal() checks
authorOleg Nesterov <oleg@redhat.com>
Tue, 17 Mar 2026 13:58:18 +0000 (14:58 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 28 Mar 2026 04:19:48 +0000 (21:19 -0700)
commit0f8e38eeb995bf818a7f220de109d6b6b96038b4
tree1cb54b74dee79dbf857d815750e0375307d20f6c
parent4580900fe184dcb2a4e32e28951a3aa0726dc48b
do_notify_parent: sanitize the valid_signal() checks

Now that kernel_clone() checks valid_signal(args->exit_signal), the "sig"
argument of do_notify_parent() must always be valid or we have a bug.

However, do_notify_parent() only checks that sig != -1 at the start, then
it does another valid_signal() check before __send_signal_locked().

This is confusing.  Change do_notify_parent() to WARN and return early if
valid_signal(sig) is false.

Link: https://lkml.kernel.org/r/abld-ilvMEZ7VgMw@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Deepanshu Kartikey <Kartikey406@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/signal.c