Jeff Moyer 75e1c70fc3 aio: check for multiplication overflow in do_io_submit
Tavis Ormandy pointed out that do_io_submit does not do proper bounds
checking on the passed-in iocb array:

       if (unlikely(nr < 0))
               return -EINVAL;

       if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(iocbpp)))))
               return -EFAULT;                      ^^^^^^^^^^^^^^^^^^

The attached patch checks for overflow, and if it is detected, the
number of iocbs submitted is scaled down to a number that will fit in
the long.  This is an ok thing to do, as sys_io_submit is documented as
returning the number of iocbs submitted, so callers should handle a
return value of less than the 'nr' argument passed in.

Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-09-14 17:02:37 -07:00
..
2010-06-16 18:05:05 +02:00
2010-08-09 16:48:53 -04:00
2010-08-18 01:01:33 -04:00
2010-05-19 22:41:57 -04:00
2010-08-05 14:23:45 -05:00
2010-08-09 16:48:45 -04:00
2010-08-18 01:09:01 -04:00
2010-09-07 13:42:41 +02:00
2010-08-18 06:21:10 -04:00
2010-08-09 16:48:17 -04:00
2010-08-09 16:48:16 -04:00
2010-08-09 16:47:49 -04:00
2010-08-18 01:09:01 -04:00
2010-08-18 01:09:01 -04:00
2010-08-14 00:24:24 +02:00
2010-08-09 16:47:31 -04:00
2010-08-18 01:09:01 -04:00
2010-01-26 22:22:26 -05:00
2010-08-09 16:48:00 -04:00
2010-08-18 01:09:01 -04:00
2010-08-18 01:09:01 -04:00
2010-08-18 08:35:48 -04:00
2010-05-11 17:43:58 +02:00
2010-08-18 08:35:48 -04:00
2010-08-18 08:35:46 -04:00
2010-08-18 08:35:48 -04:00
2010-03-08 16:55:37 +01:00
2010-05-21 18:31:17 -04:00
2010-08-18 08:35:48 -04:00
2010-08-18 08:35:47 -04:00
2010-06-10 19:08:34 +02:00
2010-08-18 08:35:48 -04:00
2010-03-12 15:52:32 -08:00
2010-08-09 16:48:44 -04:00
2010-08-18 08:35:48 -04:00
2010-08-09 16:47:43 -04:00