Skip to content

Commit

Permalink
Revert to original version of setxid race fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schwab committed Mar 8, 2010
1 parent b886abf commit 058e9ba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2010-03-08 Andreas Schwab <schwab@redhat.com>

* pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
* allocatestack.c (get_cached_stack): Set setxid_futex.
(allocate_stack): Likewise.

2010-03-05 Andreas Schwab <schwab@redhat.com>
Ulrich Drepper <drepper@redhat.com>

Expand Down
9 changes: 9 additions & 0 deletions nptl/allocatestack.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ get_cached_stack (size_t *sizep, void **memp)
return NULL;
}

/* Don't allow setxid until cloned. */
result->setxid_futex = -1;

/* Dequeue the entry. */
stack_list_del (&result->list);

Expand Down Expand Up @@ -418,6 +421,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
/* The process ID is also the same as that of the caller. */
pd->pid = THREAD_GETMEM (THREAD_SELF, pid);

/* Don't allow setxid until cloned. */
pd->setxid_futex = -1;

/* Allocate the DTV for this thread. */
if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL)
{
Expand Down Expand Up @@ -554,6 +560,9 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
THREAD_SYSINFO(pd) = THREAD_SELF_SYSINFO;
#endif

/* Don't allow setxid until cloned. */
pd->setxid_futex = -1;

/* The process ID is also the same as that of the caller. */
pd->pid = THREAD_GETMEM (THREAD_SELF, pid);

Expand Down
3 changes: 0 additions & 3 deletions nptl/pthread_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,6 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
}
}

/* Don't allow setxid until cloned. */
pd->setxid_futex = -1;

/* Pass the descriptor to the caller. */
*newthread = (pthread_t) pd;

Expand Down

0 comments on commit 058e9ba

Please sign in to comment.