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

Oleg Nesterov
2026-03-17T12:49:05Z

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.

Oleg.