[PATCH] nptl: Retry SIGSETXID delivery on EAGAIN in setxid (bug 21108)
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Wed Jun 10 16:25:40 GMT 2026
On 10/06/26 11:20, Andreas Schwab wrote:
> On Jun 09 2026, Adhemerval Zanella wrote:
>
>> @@ -150,31 +150,86 @@ setxid_unmark_thread (struct xid_command *cmdp, struct pthread *t)
>> }
>>
>>
>> -static int
>> +enum setxid_signal_state
>> +{
>> + setxid_signal_done, /* Thread has not finished starting or has already
>> + exited; ignore it. */
>> + setxid_signal_sent, /* The signal was delivered and the thread signal
>> + handler will run (the xid_command::crnt was already
>> + incremented. */
>> + setxid_signal_retry, /* tgkill returned EAGAIN (the signal queue
>> + RLIMIT_SIGPENDING is full), the thread is still
>> + running and must be signal. The caller has to
> signaled
>
>> + /* The kernel might return EAGAIN for realtime signals if the signal queue
>> + reaches its limits (RLIMIT_SIGPENDING) because tgkill does not use the
>> + guaranteed-delivery override path as the kill syscall. The threads is
> thread
>
>> + still running and *must* process the credential change, so instruc the
> instruct
>
>> +/* The sexid is implemented on Linux with a SIGSETXID broadcast, and tgkill
>> + might fail with EAGAIN if the signal queue is full (RLIMIT_SIGPENDING)
>> + because SIGSETXID is a realtime signal.
>> +
>> + The test first fills the queue, run the setresuid in a helper thread, and
> runs
>
>> + verifiers that it does *not* complete while the queue is still full.
> verifies
>
Ack, fixed locally.
More information about the Libc-alpha
mailing list