]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Revert to original version of setxid race fix
authorAndreas Schwab <schwab@redhat.com>
Mon, 8 Mar 2010 16:01:14 +0000 (17:01 +0100)
committerAndreas Schwab <schwab@redhat.com>
Mon, 8 Mar 2010 16:02:46 +0000 (17:02 +0100)
nptl/ChangeLog
nptl/allocatestack.c
nptl/pthread_create.c

index e0e1a5392fd1a54fe7b1155e9276671bb73611c3..fa4c8f2f9f49ca229faddc5bb046df6328c06b58 100644 (file)
@@ -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>
 
index 899c0e8eee9fc263d5dcaf8662c3513c62a781d7..831e98e4ce8ee608fbd08b26bb2162fcfc4a7229 100644 (file)
@@ -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);
 
index 194a8ba0ab55d49eebb0b0a1d6e8ed9e751a2078..14e3cf784bd4bfcf2d21d92a6df675874c94c4a7 100644 (file)
@@ -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;