diff options
author | Jeff Moyer <jmoyer@redhat.com> | 2010-09-10 14:16:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-14 17:02:37 -0700 |
commit | 75e1c70fc31490ef8a373ea2a4bea2524099b478 (patch) | |
tree | 4fc943276b4a34374ac26d69e63b815bf66c2451 /net/802/fc.c | |
parent | bfa88ea7ee9e6b4fd673e45a8cc0a8e0b7ef4761 (diff) | |
download | linux-stable-75e1c70fc31490ef8a373ea2a4bea2524099b478.tar.gz linux-stable-75e1c70fc31490ef8a373ea2a4bea2524099b478.tar.bz2 linux-stable-75e1c70fc31490ef8a373ea2a4bea2524099b478.zip |
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>
Diffstat (limited to 'net/802/fc.c')
0 files changed, 0 insertions, 0 deletions