Re: [PATCH v3] kernel/fork: validate exit_signal in kernel_clone()

Christian Brauner
2026-03-17T14:10:19Z

On Tue, Mar 17, 2026 at 01:48:42PM +0100, Oleg Nesterov wrote:
> On 03/16, Deepanshu Kartikey wrote:
> >
> > Note that this is a user-visible change: previously, passing an invalid
> > exit_signal to clone() was silently accepted. The man page for clone()
> > does not document any defined behavior for invalid exit_signal values,
> > so rejecting them with -EINVAL is the correct behavior. It is unlikely
> > that any sane application relies on passing an invalid exit_signal.
>
> Agreed...
>
> > - if (unlikely((args.exit_signal & ~((u64)CSIGNAL)) ||
> > - !valid_signal(args.exit_signal)))
> > + if (unlikely(args.exit_signal & ~((u64)CSIGNAL)))
> > return -EINVAL;
>
> I guess this can die too, but OK, this needs another patch/changelog.
>
> Acked-by: Oleg Nesterov <oleg@redhat.com>
>
>
> Andrew, I will slightly update the changelog and resend
> do_notify_parent-sanitize-the-valid_signal-checks.patch
> in reply to this patch from Deepanshu.

I'll take this via the pidfs/kernel tree. I also have a bunch of work
touching this stuff queued there.