about summary refs log tree commit diff
path: root/nptl/allocatestack.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-03-08 17:01:14 +0100
committerAndreas Schwab <schwab@redhat.com>2010-03-08 17:02:46 +0100
commit058e9ba9fd03b86246b8ed3c49392fa783a5c337 (patch)
treef489a651b93610bd5f3bd56032846be663785e83 /nptl/allocatestack.c
parentb886abfbacc5799dd29d4068338a488b17964e51 (diff)
downloadglibc-058e9ba9fd03b86246b8ed3c49392fa783a5c337.tar.gz
glibc-058e9ba9fd03b86246b8ed3c49392fa783a5c337.tar.xz
glibc-058e9ba9fd03b86246b8ed3c49392fa783a5c337.zip
Revert to original version of setxid race fix
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r--nptl/allocatestack.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 899c0e8eee..831e98e4ce 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -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);
 
@@ -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)
 	{
@@ -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);