Re: [PATCH v3] kernel/fork: validate exit_signal in kernel_clone()
From: Oleg Nesterov
Date: Tue Mar 17 2026 - 08:49:12 EST
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.
Oleg.