Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180601014804.GR1392@brightrain.aerifal.cx>
Date: Thu, 31 May 2018 21:48:04 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] SYS_futex FUTEX_WAIT requires a valid timeout
 argument

On Fri, Jun 01, 2018 at 11:23:11AM +1000, Patrick Oppenlander wrote:
> On Fri., 1 Jun. 2018, 11:01 Rich Felker, <dalias@...c.org> wrote:
> 
> > On Fri, Jun 01, 2018 at 10:49:20AM +1000, patrick.oppenlander@...il.com
> > wrote:
> > > From: Patrick Oppenlander <patrick.oppenlander@...il.com>
> > >
> > > ---
> > >  src/internal/pthread_impl.h | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
> > > index fc2def63..97522bfe 100644
> > > --- a/src/internal/pthread_impl.h
> > > +++ b/src/internal/pthread_impl.h
> > > @@ -155,8 +155,8 @@ static inline void __wake(volatile void *addr, int
> > cnt, int priv)
> > >  static inline void __futexwait(volatile void *addr, int val, int priv)
> > >  {
> > >       if (priv) priv = FUTEX_PRIVATE;
> > > -     __syscall(SYS_futex, addr, FUTEX_WAIT|priv, val) != -ENOSYS ||
> > > -     __syscall(SYS_futex, addr, FUTEX_WAIT, val);
> > > +     __syscall(SYS_futex, addr, FUTEX_WAIT|priv, val, 0) != -ENOSYS ||
> > > +     __syscall(SYS_futex, addr, FUTEX_WAIT, val, 0);
> > >  }
> > >
> > >  void __acquire_ptc(void);
> > > --
> > > 2.17.0
> >
> > This looks correct. Did you hit things that broke because it was
> > missing?
> >
> > Rich
> >
> 
> Syscall argument validation in my nommu kernel caught it. I'm sure Linux
> would catch it too.
> 
> I didn't prove that it causes observable issues in userspace.

OK. I just like to know if there is a known visible failure users have
seen so I can document it in the commit message. But if nothing was
seen, no problem.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.