[PATCH] nptl: Fix abort in case of set*id failure

Florian Weimer fweimer@redhat.com
Mon Apr 28 13:06:00 GMT 2014


On 04/28/2014 02:50 PM, Ondřej Bílka wrote:
> On Mon, Apr 28, 2014 at 02:03:02PM +0200, Florian Weimer wrote:
>> 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).
>
> A code itself makes sense. However I am not familiar with nptl enough to decide
> if its proper solution, like why there is not a race condition if other
> thread calls setuid that succeeds followed by setuid that fails.

There is supposed to be locking to prevent this.  I'm not entirely sure 
if it is sufficient, but my additions do not make things worse.

-- 
Florian Weimer / Red Hat Product Security Team



More information about the Libc-alpha mailing list