Re: futex: FUTEX_WAIT: check for normalized timeout

2018-05-09 Thread Scott Cheloha
On Wed, May 09, 2018 at 11:54:15AM +0300, Paul Irofti wrote: > On Wed, May 09, 2018 at 10:37:14AM +0200, Martin Pieuchot wrote: > > On 08/05/18(Tue) 14:57, Scott Cheloha wrote: > > > Hi, > > > > > > futex(2) doesn't do any range checking for timeout for FUTEX_WAIT, > > > though recent Linux does s

Re: futex: FUTEX_WAIT: check for normalized timeout

2018-05-09 Thread Paul Irofti
On Wed, May 09, 2018 at 10:37:14AM +0200, Martin Pieuchot wrote: > On 08/05/18(Tue) 14:57, Scott Cheloha wrote: > > Hi, > > > > futex(2) doesn't do any range checking for timeout for FUTEX_WAIT, > > though recent Linux does so. I assume we'd also want to validate > > timeout before waiting. > >

Re: futex: FUTEX_WAIT: check for normalized timeout

2018-05-09 Thread Martin Pieuchot
On 08/05/18(Tue) 14:57, Scott Cheloha wrote: > Hi, > > futex(2) doesn't do any range checking for timeout for FUTEX_WAIT, > though recent Linux does so. I assume we'd also want to validate > timeout before waiting. Could you use timespecfix() for that? Look how pselect(2) or ppoll(2) do it. Bt

futex: FUTEX_WAIT: check for normalized timeout

2018-05-08 Thread Scott Cheloha
Hi, futex(2) doesn't do any range checking for timeout for FUTEX_WAIT, though recent Linux does so. I assume we'd also want to validate timeout before waiting. The attached returns EINVAL if timeout's fields are non-normal, documents it, and adds a test case. ok? -- Scott Cheloha Index: lib/l