Re: [PATCH -mm v2] do_notify_parent: sanitize the valid_signal() checks
From: Andrew Morton
Date: Tue Mar 17 2026 - 14:37:54 EST
On Tue, 17 Mar 2026 14:58:18 +0100 Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> 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.
Sashiko has a question:
https://sashiko.dev/#/patchset/abld-ilvMEZ7VgMw%40redhat.com