]> git.baikalelectronics.ru Git - kernel.git/commit
iov_iter_advance() fix
authorNick Piggin <npiggin@suse.de>
Mon, 10 Mar 2008 18:43:59 +0000 (11:43 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 11 Mar 2008 01:01:20 +0000 (18:01 -0700)
commit7e128b61074719408e775c874a7f72de80863f5e
tree163c2fa590e3de5c9084f1cba5c1c2815dbd2dde
parente49a93752a590ddad1d244c3e3a1ebdf1ec643a5
iov_iter_advance() fix

iov_iter_advance() skips over zero-length iovecs, however it does not properly
terminate at the end of the iovec array.  Fix this by checking against
i->count before we skip a zero-length iov.

The bug was reproduced with a test program that continually randomly creates
iovs to writev.  The fix was also verified with the same program and also it
could verify that the correct data was contained in the file after each
writev.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Tested-by: "Kevin Coffman" <kwc@citi.umich.edu>
Cc: "Alexey Dobriyan" <adobriyan@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c