1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

nptl: Preserve error in setxid thread broadcast in coredumps [BZ #22153]

This commit is contained in:
Peter Zelezny
2017-10-13 22:49:49 +02:00
committed by Florian Weimer
parent 8644588807
commit e4f530da0d
2 changed files with 13 additions and 2 deletions

View File

@ -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));
}