diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-30 22:20:18 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-01 12:43:13 -0700 |
commit | a6b79bb88e6682d2739aa5b4db7184038bbb32ce (patch) | |
tree | bf9b9aac26cc6c35ea59c339e473c171b1b6d704 /drivers/net/ethernet/natsemi/sonic.c | |
parent | 293f49dd74ffd6a9c453f73f01e812bd4e3d9357 (diff) |
Fix off-by-one error in iov_iter_advance()
commit 94ad374a0751f40d25e22e036c37f7263569d24c upstream
The iov_iter_advance() function would look at the iov->iov_len entry
even though it might have iterated over the whole array, and iov was
pointing past the end. This would cause DEBUG_PAGEALLOC to trigger a
kernel page fault if the allocation was at the end of a page, and the
next page was unallocated.
The quick fix is to just change the order of the tests: check that there
is any iovec data left before we check the iov entry itself.
Thanks to Alexey Dobriyan for finding this case, and testing the fix.
Reported-and-tested-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/ethernet/natsemi/sonic.c')
0 files changed, 0 insertions, 0 deletions