linux/fs/fuse
Miklos Szeredi f658adeea4 fix up iter on short count in fuse_direct_io()
fuse_direct_io() can end up advancing the iterator by more than the amount
of data read or written.  This case is handled by the generic code if going
through ->direct_IO(), but not in the FOPEN_DIRECT_IO case.

Fix by reverting the extra bytes from the iterator in case of error or a
short count.

To test: install lxcfs, then the following testcase
  int fd = open("/var/lib/lxcfs/proc/uptime", O_RDONLY);
  sendfile(1, fd, NULL, 16777216);
  sendfile(1, fd, NULL, 16777216);
will spew WARN_ON() in iov_iter_pipe().

Reported-by: Peter Geis <pgwipeout@gmail.com>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: 3c3db095b6 ("fuse: use iov_iter based generic splice helpers")
Cc: <stable@vger.kernel.org> # v5.1
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2020-02-06 16:39:28 +01:00
..
acl.c fuse: Support fuse filesystems outside of init_user_ns 2018-03-20 17:11:44 +01:00
control.c convenience helper: get_tree_single() 2019-07-04 22:01:58 -04:00
cuse.c fuse: fix memleak in cuse_channel_open 2019-09-24 15:28:01 +02:00
dev.c pipe: Fix iteration end check in fuse_dev_splice_write() 2019-12-06 13:57:04 -08:00
dir.c fuse: verify nlink 2019-11-12 11:49:04 +01:00
file.c fix up iter on short count in fuse_direct_io() 2020-02-06 16:39:28 +01:00
fuse_i.h fuse: verify attributes 2019-11-12 11:49:04 +01:00
inode.c virtio-fs: don't show mount options 2019-10-15 16:11:41 +02:00
Kconfig fuse: fix Kconfig indentation 2019-11-27 09:35:20 +01:00
Makefile virtio-fs: Change module name to virtiofs.ko 2019-10-14 10:20:33 +02:00
readdir.c fuse: verify attributes 2019-11-12 11:49:04 +01:00
virtio_fs.c virtiofs: Use completions while waiting for queue to be drained 2019-11-22 13:29:50 +01:00
xattr.c fuse: rearrange and resize fuse_args fields 2019-09-10 16:29:48 +02:00