Re: int overflow in io_getevents

2016-10-26 Thread Jiri Slaby
Hi, what's the status of this? I have just hit it now and don't see it merged. On 01/07/2016, 05:27 PM, Dmitry Vyukov wrote: > On Thu, Jan 7, 2016 at 4:52 PM, Benjamin LaHaise wrote: >> On Thu, Jan 07, 2016 at 04:37:43PM +0100, Dmitry Vyukov wrote: >>> pass ts to the function >> >> Yeah, I shoul

Re: int overflow in io_getevents

2016-01-07 Thread Benjamin LaHaise
On Thu, Jan 07, 2016 at 04:37:43PM +0100, Dmitry Vyukov wrote: > pass ts to the function Yeah, I should have had my morning coffee before hitting send. Updated below, and hopefully final. Checked with a test program to confirm that the huge value of seconds in timespec correctly waits, and tha

Re: int overflow in io_getevents

2016-01-07 Thread Dmitry Vyukov
On Thu, Jan 7, 2016 at 4:31 PM, Benjamin LaHaise wrote: > On Thu, Jan 07, 2016 at 10:12:02AM +0100, Dmitry Vyukov wrote: > ... >> Sorry, but the following program still prints -9223372036562067969. I >> think timespec_valid check will do. > > Ah, right. Yes, using timespec_valid() instead of tim

Re: int overflow in io_getevents

2016-01-07 Thread Benjamin LaHaise
On Thu, Jan 07, 2016 at 10:12:02AM +0100, Dmitry Vyukov wrote: ... > Sorry, but the following program still prints -9223372036562067969. I > think timespec_valid check will do. Ah, right. Yes, using timespec_valid() instead of timespec_valid_strict() as initially proposed will address my concer

Re: int overflow in io_getevents

2016-01-07 Thread Dmitry Vyukov
On Wed, Jan 6, 2016 at 7:01 PM, Benjamin LaHaise wrote: > On Wed, Dec 16, 2015 at 07:38:33PM +0100, Dmitry Vyukov wrote: >> > Yup, looks correct. Will you send a patch? >> >> I've drafted the verification: >> >> @@ -1269,6 +1269,8 @@ static long read_events(struct kioctx *ctx, long >> min_nr, long

Re: int overflow in io_getevents

2016-01-06 Thread Benjamin LaHaise
On Wed, Dec 16, 2015 at 07:38:33PM +0100, Dmitry Vyukov wrote: > > Yup, looks correct. Will you send a patch? > > I've drafted the verification: > > @@ -1269,6 +1269,8 @@ static long read_events(struct kioctx *ctx, long > min_nr, long nr, > > if (unlikely(copy_from_user(&ts, time

Re: int overflow in io_getevents

2015-12-18 Thread Jan Kara
On Wed 16-12-15 19:38:33, Dmitry Vyukov wrote: > On Wed, Dec 16, 2015 at 1:56 PM, Jan Kara wrote: > > On Mon 07-12-15 11:27:07, Dmitry Vyukov wrote: > >> Hello, > >> > >> While running syzkaller fuzzer on commit > >> 31ade3b83e1821da5fbb2f11b5b3d4ab2ec39db8, I've hit the following UBSAN > >> warni

Re: int overflow in io_getevents

2015-12-16 Thread Dmitry Vyukov
On Wed, Dec 16, 2015 at 1:56 PM, Jan Kara wrote: > On Mon 07-12-15 11:27:07, Dmitry Vyukov wrote: >> Hello, >> >> While running syzkaller fuzzer on commit >> 31ade3b83e1821da5fbb2f11b5b3d4ab2ec39db8, I've hit the following UBSAN >> warning. I think it can lead to an unexpected active wait loop, if

Re: int overflow in io_getevents

2015-12-16 Thread Jan Kara
On Mon 07-12-15 11:27:07, Dmitry Vyukov wrote: > Hello, > > While running syzkaller fuzzer on commit > 31ade3b83e1821da5fbb2f11b5b3d4ab2ec39db8, I've hit the following UBSAN > warning. I think it can lead to an unexpected active wait loop, if > user-space expects such io_getevents to wait for a lo