1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Fix setxid race handling exiting threads

This commit is contained in:
Andreas Schwab
2010-06-25 10:41:17 +02:00
parent 2bc174332b
commit 523df51151
2 changed files with 15 additions and 1 deletions

View File

@ -999,7 +999,16 @@ setxid_mark_thread (struct xid_command *cmdp, struct pthread *t)
/* If the thread is exiting right now, ignore it. */
if ((ch & EXITING_BITMASK) != 0)
return;
{
/* Release the futex if there is no other setxid in
progress. */
if ((ch & SETXID_BITMASK) == 0)
{
t->setxid_futex = 1;
lll_futex_wake (&t->setxid_futex, 1, LLL_PRIVATE);
}
return;
}
}
while (atomic_compare_and_exchange_bool_acq (&t->cancelhandling,
ch | SETXID_BITMASK, ch));