]> git.baikalelectronics.ru Git - kernel.git/commit
fuse: verify all ioctl retry iov elements
authorZach Brown <zab@redhat.com>
Tue, 24 Jul 2012 19:10:11 +0000 (12:10 -0700)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 6 Aug 2012 16:19:24 +0000 (18:19 +0200)
commit684d336721e6a23580375fa8cfb22d7b65775e9f
treef8fa90871e06797a09dd886a2dacf26b199ea667
parent76cf1042da5ff4512af30ab0183a6d86c513ee5c
fuse: verify all ioctl retry iov elements

Commit ba29dfde0c3dc1fdf87401caac5c7f1f5e3deaaf attempted to verify that
the total iovec from the client doesn't overflow iov_length() but it
only checked the first element.  The iovec could still overflow by
starting with a small element.  The obvious fix is to check all the
elements.

The overflow case doesn't look dangerous to the kernel as the copy is
limited by the length after the overflow.  This fix restores the
intention of returning an error instead of successfully copying less
than the iovec represented.

I found this by code inspection.  I built it but don't have a test case.
I'm cc:ing stable because the initial commit did as well.

Signed-off-by: Zach Brown <zab@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: <stable@vger.kernel.org> [2.6.37+]
fs/fuse/file.c