Skip to content

Commit

Permalink
Fix setxid race handling exiting threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schwab committed Jul 2, 2010
1 parent 2f811bf commit 5d073f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2010-06-28 Andreas Schwab <schwab@redhat.com>

* allocatestack.c (setxid_mark_thread): Ensure that the exiting
thread is woken up.

* elf/Makefile: Add rules to build and run unload8 test.
* elf/unload8.c: New file.
* elf/unload8mod1.c: New file.
Expand Down
11 changes: 10 additions & 1 deletion nptl/allocatestack.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,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));
Expand Down

0 comments on commit 5d073f1

Please sign in to comment.