]> git.kernelconcepts.de Git - karo-tx-linux.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)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Oct 2012 21:38:17 +0000 (23:38 +0200)
commit97744669e0e6c31e76182010f25451ccda5abe86
tree9436fb634390bffdf7281c68c1ade2faa71a9252
parent663464d6903019adbcec64129acb093f95fb0141
fuse: verify all ioctl retry iov elements

commit fb6ccff667712c46b4501b920ea73a326e49626a upstream.

Commit 7572777eef78ebdee1ecb7c258c0ef94d35bad16 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/fuse/file.c