linux/fs/fuse
Miklos Szeredi c079916d88 fuse: prevent overflow in copy_file_range return value
commit 1e08938c36 upstream.

The FUSE protocol uses struct fuse_write_out to convey the return value of
copy_file_range, which is restricted to uint32_t.  But the COPY_FILE_RANGE
interface supports a 64-bit size copies.

Currently the number of bytes copied is silently truncated to 32-bit, which
may result in poor performance or even failure to copy in case of
truncation to zero.

Reported-by: Florian Weimer <fweimer@redhat.com>
Closes: https://lore.kernel.org/all/lhuh5ynl8z5.fsf@oldenburg.str.redhat.com/
Fixes: 88bc7d5097 ("fuse: add support for copy_file_range()")
Cc: <stable@vger.kernel.org> # v4.20
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-09-19 16:29:57 +02:00
..
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
control.c fuse: Remove the control interface for virtio-fs 2022-07-21 16:06:19 +02:00
cuse.c fuse: fix UAF in rcu pathwalks 2024-08-29 17:30:34 +02:00
dax.c fuse: fix dax truncate/punch_hole fault path 2025-04-10 14:33:36 +02:00
dev.c fuse: add request extension 2024-09-12 11:10:27 +02:00
dir.c fuse: Return EPERM rather than ENOSYS from link() 2025-06-04 14:40:02 +02:00
file.c fuse: prevent overflow in copy_file_range return value 2025-09-19 16:29:57 +02:00
fuse_i.h fuse: add request extension 2024-09-12 11:10:27 +02:00
inode.c fuse: add feature flag for expire-only 2024-09-12 11:10:30 +02:00
ioctl.c fuse: ioctl: translate ENOSYS in outarg 2023-07-27 08:50:25 +02:00
Kconfig dax: remove CONFIG_DAX_DRIVER 2021-12-04 08:58:51 -08:00
Makefile fuse: move ioctl to separate source file 2021-04-12 15:04:30 +02:00
readdir.c fuse: nlookup missing decrement in fuse_direntplus_link 2023-09-19 12:28:05 +02:00
virtio_fs.c virtiofs: add filesystem context source name check 2025-04-25 10:43:55 +02:00
xattr.c fuse: use unsigned type for getxattr/listxattr size truncation 2024-09-12 11:10:17 +02:00