about summary refs log tree commit diff
path: root/nptl/nptl-init.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2014-07-10 17:34:46 +0200
committerFlorian Weimer <fweimer@redhat.com>2014-07-11 12:30:53 +0200
commit771eb1415fde935e377111f69364a5d92a29e67d (patch)
tree1e9dd40b64e87fe715c4bc7ccee7487c6e500a8a /nptl/nptl-init.c
parentbc1da1765e901a9a9f532f91d09f5237655e01fd (diff)
downloadglibc-771eb1415fde935e377111f69364a5d92a29e67d.tar.gz
glibc-771eb1415fde935e377111f69364a5d92a29e67d.tar.xz
glibc-771eb1415fde935e377111f69364a5d92a29e67d.zip
nptl: Fix abort in case of set*id failure [BZ #17135]
If a call to the set*id functions fails in a multi-threaded program,
the abort introduced in commit 13f7fe35ae2b0ea55dc4b9628763aafdc8bdc30c
was triggered.

We address by checking that all calls to set*id on all threads give
the same result, and only abort if we see success followed by failure
(or vice versa).
Diffstat (limited to 'nptl/nptl-init.c')
-rw-r--r--nptl/nptl-init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 2796dc5182..9f7b20a90e 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -248,10 +248,10 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
   INTERNAL_SYSCALL_DECL (err);
   result = INTERNAL_SYSCALL_NCS (__xidcmd->syscall_no, err, 3, __xidcmd->id[0],
 				 __xidcmd->id[1], __xidcmd->id[2]);
+  int error = 0;
   if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
-    /* Safety check.  This should never happen if the setxid system
-       calls are only ever called through their glibc wrappers.  */
-    abort ();
+    error = INTERNAL_SYSCALL_ERRNO (result, err);
+  __nptl_setxid_error (__xidcmd, error);
 
   /* Reset the SETXID flag.  */
   struct pthread *self = THREAD_SELF;