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

From: Christian Brauner

Date: Tue Mar 17 2026 - 10:16:58 EST


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@xxxxxxxxxx>
>
>
> 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.