lkml.org 
[lkml]   [2014]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 1/5] futex: Make unlock_pi more robust
From
Date
On Tue, 2014-06-17 at 00:28 +0200, Thomas Gleixner wrote:
> On Tue, 17 Jun 2014, Thomas Gleixner wrote:
> > On Mon, 16 Jun 2014, Darren Hart wrote:
> > > On Wed, 2014-06-11 at 20:45 +0000, Thomas Gleixner wrote:
> > > In wake_futex_pi we verify ownership by matching pi_state->owner ==
> > > current, but here the only test is the TID value, which is set by
> > > userspace - which we don't trust...
> > >
> > > I'm trying to determine if it matters in this case... if there are no
> > > waiters, is the pi_state still around? If so, it does indeed matter, and
> > > we should be verifying.
> >
> > Erm. The whole point of this patch is to do:
> >
> > - Find existing state first and handle it.
> >
> > - If no state exists and TID == current, take it
> >
> > - Otherwise create state
>
> Duh, that was the lock path. But here the point is:
>
> - Find existing state first and handle it.
>
> - If no state exists and TID == current, release it
>

Right, I understood your meaning, and I withdraw the concern.

> The retry is obvious, right?

Yes.

--
Darren Hart
Intel Open Source Technology Center




\
 
 \ /
  Last update: 2014-06-17 01:01    [W:0.125 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site