From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12877 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] SYS_futex FUTEX_WAIT requires a valid timeout argument Date: Thu, 31 May 2018 21:48:04 -0400 Message-ID: <20180601014804.GR1392@brightrain.aerifal.cx> References: <20180601004920.3465-1-patrick.oppenlander@gmail.com> <20180601010107.GQ1392@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1527817578 1463 195.159.176.226 (1 Jun 2018 01:46:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2018 01:46:18 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12893-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jun 01 03:46:14 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fOZ8v-0000BT-DW for gllmg-musl@m.gmane.org; Fri, 01 Jun 2018 03:46:13 +0200 Original-Received: (qmail 26058 invoked by uid 550); 1 Jun 2018 01:48:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 26038 invoked from network); 1 Jun 2018 01:48:16 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12877 Archived-At: On Fri, Jun 01, 2018 at 11:23:11AM +1000, Patrick Oppenlander wrote: > On Fri., 1 Jun. 2018, 11:01 Rich Felker, wrote: > > > On Fri, Jun 01, 2018 at 10:49:20AM +1000, patrick.oppenlander@gmail.com > > wrote: > > > From: Patrick Oppenlander > > > > > > --- > > > 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