summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorPeter Zelezny <peter.zelezny@dektech.com.au>2017-10-13 22:49:49 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-10-13 22:51:56 +0200
commite4f530da0db59ff51549c11ed6ef799b4ade1c87 (patch)
tree112e2f47c7bf1bd0228531e472fdab124700cc1b /nptl
parent8644588807215ab09716ac04a150f91ac83acffd (diff)
downloadglibc-e4f530da0db59ff51549c11ed6ef799b4ade1c87.tar.gz
glibc-e4f530da0db59ff51549c11ed6ef799b4ade1c87.tar.xz
glibc-e4f530da0db59ff51549c11ed6ef799b4ade1c87.zip
nptl: Preserve error in setxid thread broadcast in coredumps [BZ #22153]
Diffstat (limited to 'nptl')
-rw-r--r--nptl/allocatestack.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 196371a88f..ad9add8d2a 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -1105,8 +1105,13 @@ __nptl_setxid_error (struct xid_command *cmdp, int error)
       if (olderror == error)
 	break;
       if (olderror != -1)
-	/* Mismatch between current and previous results.  */
-	abort ();
+	{
+	  /* Mismatch between current and previous results.  Save the
+	     error value to memory so that is not clobbered by the
+	     abort function and preserved in coredumps.  */
+	  volatile int xid_err __attribute__((unused)) = error;
+	  abort ();
+	}
     }
   while (atomic_compare_and_exchange_bool_acq (&cmdp->error, error, -1));
 }