Re: [PATCH] signal: cleanup the .si_signo checks in dequeue_synchronous_signal()
From: Eric W. Biederman
Date: Fri Oct 23 2026 - 12:56:13 EST
Oleg Nesterov <oleg@xxxxxxxxxx> writes:
> Christian,
>
> This is on top of Avi's
> [PATCH v2] signal: respect the blocked mask in dequeue_synchronous_signal()
>
> If you are going to update your tree and take V2 + my cleanup, I will not
> mind if you fold my patch into the fix from Avi.
>
> And! I just noticed the sashiko's review of Avi's patch:
> https://sashiko.dev/#/patchset/20261022061015.3737924-1-thnkslprpt%40gmail.com
>
> It noticed the problem with UB too. But, unlike me, it noticed another problem
> with the "still_pending" logic. The described scenario is not possible after my
> change, but we have the same problem with posix timers.
>
> This needs another change. I'll try to think a bit to avoid a "brute
> force" fix.
One thing we can reasonably do is to disallow sending signals that
are "from the kernel" to ourselves if the signal number is a real time
signal.
Since the kernel won't generate any of those there is no need to restore
them, or test them. So allowing them is unnecessary and leads to bugs
in the code.
I don't know how useful that would be but it is an option.
Eric