* [withdrawn] do_notify_parent-sanitize-the-valid_signal-checks.patch removed from -mm tree
@ 2026-03-09 20:09 Andrew Morton
2026-03-15 20:04 ` Oleg Nesterov
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2026-03-09 20:09 UTC (permalink / raw)
To: mm-commits, mjguzik, kees, brauner, oleg, akpm
The quilt patch titled
Subject: do_notify_parent: sanitize the valid_signal() checks
has been removed from the -mm tree. Its filename was
do_notify_parent-sanitize-the-valid_signal-checks.patch
This patch was dropped because it was withdrawn
------------------------------------------------------
From: Oleg Nesterov <oleg@redhat.com>
Subject: do_notify_parent: sanitize the valid_signal() checks
Date: Sun, 22 Feb 2026 16:23:47 +0100
The "sig" argument of do_notify_parent() must always be valid and it does
WARN_ON_ONCE(sig == -1) at the start. The 2nd valid_signal() check before
__send_signal_locked() must always be true or we have a bug.
This is confusing. Change do_notify_parent() to WARN and return early if
valid_signal(sig) is false.
Link: https://lkml.kernel.org/r/aZsfg0Y055yuAvsq@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Kees Cook <kees@kernel.org>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc; Deepanshu Kartikey <kartikey406@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
kernel/signal.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/kernel/signal.c~do_notify_parent-sanitize-the-valid_signal-checks
+++ a/kernel/signal.c
@@ -2173,7 +2173,8 @@ bool do_notify_parent(struct task_struct
bool autoreap = false;
u64 utime, stime;
- WARN_ON_ONCE(sig == -1);
+ if (WARN_ON_ONCE(!valid_signal(sig)))
+ return false;
/* do_notify_parent_cldstop should have been called instead. */
WARN_ON_ONCE(task_is_stopped_or_traced(tsk));
@@ -2254,7 +2255,7 @@ bool do_notify_parent(struct task_struct
* Send with __send_signal as si_pid and si_uid are in the
* parent's namespaces.
*/
- if (valid_signal(sig) && sig)
+ if (sig)
__send_signal_locked(sig, &info, tsk->parent, PIDTYPE_TGID, false);
__wake_up_parent(tsk, tsk->parent);
spin_unlock_irqrestore(&psig->siglock, flags);
_
Patches currently in -mm which might be from oleg@redhat.com are
exit-kill-unnecessary-thread_group_leader-checks-in-exit_notify-and-do_notify_parent.patch
complete_signal-kill-always-true-core_state-signal_group_exit-check.patch
pid-make-sub-init-creation-retryable.patch
pid-document-the-pidns_adding-checks-in-alloc_pid-and-copy_process.patch
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [withdrawn] do_notify_parent-sanitize-the-valid_signal-checks.patch removed from -mm tree
2026-03-09 20:09 [withdrawn] do_notify_parent-sanitize-the-valid_signal-checks.patch removed from -mm tree Andrew Morton
@ 2026-03-15 20:04 ` Oleg Nesterov
2026-03-16 10:47 ` Deepanshu Kartikey
0 siblings, 1 reply; 3+ messages in thread
From: Oleg Nesterov @ 2026-03-15 20:04 UTC (permalink / raw)
To: Andrew Morton, Deepanshu Kartikey; +Cc: mm-commits, mjguzik, kees, brauner
On 03/09, Andrew Morton wrote:
>
> The quilt patch titled
> Subject: do_notify_parent: sanitize the valid_signal() checks
> has been removed from the -mm tree. Its filename was
> do_notify_parent-sanitize-the-valid_signal-checks.patch
>
> This patch was dropped because it was withdrawn
OK, thanks!
but then please also drop kernel-fork-validate-exit_signal-in-clone-syscall.patch
from Deepanshu (cc'ed).
Because that patch:
- is not complete in any case
- makes no sense (at least with its current changelog) without
do_notify_parent-sanitize-the-valid_signal-checks.patch
If Deepanshu sends V2 (with the updated changelog), we can reconsider
both patches from Deepanshu and me.
Oleg.
> ------------------------------------------------------
> From: Oleg Nesterov <oleg@redhat.com>
> Subject: do_notify_parent: sanitize the valid_signal() checks
> Date: Sun, 22 Feb 2026 16:23:47 +0100
>
> The "sig" argument of do_notify_parent() must always be valid and it does
> WARN_ON_ONCE(sig == -1) at the start. The 2nd valid_signal() check before
> __send_signal_locked() must always be true or we have a bug.
>
> This is confusing. Change do_notify_parent() to WARN and return early if
> valid_signal(sig) is false.
>
> Link: https://lkml.kernel.org/r/aZsfg0Y055yuAvsq@redhat.com
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: Kees Cook <kees@kernel.org>
> Cc: Mateusz Guzik <mjguzik@gmail.com>
> Cc; Deepanshu Kartikey <kartikey406@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> kernel/signal.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> --- a/kernel/signal.c~do_notify_parent-sanitize-the-valid_signal-checks
> +++ a/kernel/signal.c
> @@ -2173,7 +2173,8 @@ bool do_notify_parent(struct task_struct
> bool autoreap = false;
> u64 utime, stime;
>
> - WARN_ON_ONCE(sig == -1);
> + if (WARN_ON_ONCE(!valid_signal(sig)))
> + return false;
>
> /* do_notify_parent_cldstop should have been called instead. */
> WARN_ON_ONCE(task_is_stopped_or_traced(tsk));
> @@ -2254,7 +2255,7 @@ bool do_notify_parent(struct task_struct
> * Send with __send_signal as si_pid and si_uid are in the
> * parent's namespaces.
> */
> - if (valid_signal(sig) && sig)
> + if (sig)
> __send_signal_locked(sig, &info, tsk->parent, PIDTYPE_TGID, false);
> __wake_up_parent(tsk, tsk->parent);
> spin_unlock_irqrestore(&psig->siglock, flags);
> _
>
> Patches currently in -mm which might be from oleg@redhat.com are
>
> exit-kill-unnecessary-thread_group_leader-checks-in-exit_notify-and-do_notify_parent.patch
> complete_signal-kill-always-true-core_state-signal_group_exit-check.patch
> pid-make-sub-init-creation-retryable.patch
> pid-document-the-pidns_adding-checks-in-alloc_pid-and-copy_process.patch
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [withdrawn] do_notify_parent-sanitize-the-valid_signal-checks.patch removed from -mm tree
2026-03-15 20:04 ` Oleg Nesterov
@ 2026-03-16 10:47 ` Deepanshu Kartikey
0 siblings, 0 replies; 3+ messages in thread
From: Deepanshu Kartikey @ 2026-03-16 10:47 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, mm-commits, mjguzik, kees, brauner
On Mon, Mar 16, 2026 at 1:34 AM Oleg Nesterov <oleg@redhat.com> wrote:
>
> but then please also drop kernel-fork-validate-exit_signal-in-clone-syscall.patch
> from Deepanshu (cc'ed).
>
> Because that patch:
>
> - is not complete in any case
>
> - makes no sense (at least with its current changelog) without
> do_notify_parent-sanitize-the-valid_signal-checks.patch
>
> If Deepanshu sends V2 (with the updated changelog), we can reconsider
> both patches from Deepanshu and me.
>
> Oleg.
I have sent patch v2
Thanks
Deepanshu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-16 10:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 20:09 [withdrawn] do_notify_parent-sanitize-the-valid_signal-checks.patch removed from -mm tree Andrew Morton
2026-03-15 20:04 ` Oleg Nesterov
2026-03-16 10:47 ` Deepanshu Kartikey
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.