This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Wed, Jul 09, 2014 at 01:01:36PM +0200, Florian Weimer wrote:
> On 07/09/2014 12:59 PM, Siddhesh Poyarekar wrote:
> >On Wed, Jul 09, 2014 at 12:42:56PM +0200, Florian Weimer wrote:
> >>Doesn't the stack_cache_lock in __nptl_setxid prevent this?  I don't know
> >>what it does to async-signal-safety, and there is likely some issue here,
> >>but I think your A/B case is properly locked out.
> >
> >Of course, I overlooked the lock.  The lock could then deadlock if
> >thread A is holding the lock and it is interrupted by another signal
> >and the handler also calls setxid.
> 
> Is there anything we can do about this?
> 
> (I don't plan to fix it with the current change, I'm just wondering if we
> can improve things further.  The same issue also appears in other contexts,
> and I wonder if there's some idiom which can be used to resolve it.)

Nothing in the short term I guess, short of masking all signals when
you're in setxid.  In the long term the real fix ought to be to have a
setxid_group set of syscalls that operate on all threads in a process.

Siddhesh

Attachment: pgpWRuHGIAUBa.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]