linux/fs/overlayfs
Amir Goldstein ca7ab48240 ovl: add permission hooks outside of do_splice_direct()
The main callers of do_splice_direct() also call rw_verify_area() for
the entire range that is being copied, e.g. by vfs_copy_file_range()
or do_sendfile() before calling do_splice_direct().

The only caller that does not have those checks for entire range is
ovl_copy_up_file().  In preparation for removing the checks inside
do_splice_direct(), add rw_verify_area() call in ovl_copy_up_file().

For extra safety, perform minimal sanity checks from rw_verify_area()
for non negative offsets also in the copy up do_splice_direct() loop
without calling the file permission hooks.

This is needed for fanotify "pre content" events.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20231122122715.2561213-2-amir73il@gmail.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2023-11-24 09:22:27 +01:00
..
copy_up.c ovl: add permission hooks outside of do_splice_direct() 2023-11-24 09:22:27 +01:00
dir.c ovl: Add an alternative type of whiteout 2023-10-31 00:12:59 +02:00
export.c ovl: reorder ovl_want_write() after ovl_inode_lock() 2023-10-31 00:12:57 +02:00
file.c ovl: add helper ovl_file_modified() 2023-10-31 00:12:55 +02:00
inode.c ovl: Move xattr support to new xattrs.c file 2023-10-31 00:12:59 +02:00
Kconfig ovl: Kconfig: introduce CONFIG_OVERLAY_FS_DEBUG 2023-08-12 19:02:53 +03:00
Makefile ovl: Move xattr support to new xattrs.c file 2023-10-31 00:12:59 +02:00
namei.c ovl: Add an alternative type of whiteout 2023-10-31 00:12:59 +02:00
overlayfs.h ovl: Add an alternative type of whiteout 2023-10-31 00:12:59 +02:00
ovl_entry.h ovl: make use of ->layers safe in rcu pathwalk 2023-10-02 17:45:02 +03:00
params.c ovl: add support for appending lowerdirs one by one 2023-10-31 00:13:02 +02:00
params.h ovl: store and show the user provided lowerdir mount option 2023-10-31 00:13:02 +02:00
readdir.c ovl: Add an alternative type of whiteout 2023-10-31 00:12:59 +02:00
super.c overlayfs update for 6.7-rc1 2023-11-07 11:46:31 -08:00
util.c vfs-6.7.fsid 2023-11-07 12:11:26 -08:00
xattrs.c ovl: Support escaped overlay.* xattrs 2023-10-31 00:12:59 +02:00