Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fuse: check if copy_file_range() returns larger than requested size

Just like write(), copy_file_range() should check if the return value is
less or equal to the requested number of bytes.

Reported-by: Chunsheng Luo <luochunsheng@ustc.edu>
Closes: https://lore.kernel.org/all/20250807062425.694-1-luochunsheng@ustc.edu/
Fixes: 88bc7d5097a1 ("fuse: add support for copy_file_range()")
Cc: <stable@vger.kernel.org> # v4.20
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>

+3
+3
fs/fuse/file.c
··· 3026 3026 fc->no_copy_file_range = 1; 3027 3027 err = -EOPNOTSUPP; 3028 3028 } 3029 + if (!err && outarg.size > len) 3030 + err = -EIO; 3031 + 3029 3032 if (err) 3030 3033 goto out; 3031 3034