linux/fs/overlayfs
Amir Goldstein da40448ce4 fs: move file_start_write() into direct_splice_actor()
The callers of do_splice_direct() hold file_start_write() on the output
file.

This may cause file permission hooks to be called indirectly on an
overlayfs lower layer, which is on the same filesystem of the output
file and could lead to deadlock with fanotify permission events.

To fix this potential deadlock, move file_start_write() from the callers
into the direct_splice_actor(), so file_start_write() will not be held
while splicing from the input file.

Suggested-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/r/20231128214258.GA2398475@perftesting/
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20231130141624.3338942-3-amir73il@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
2023-12-01 11:39:50 +01:00
..
copy_up.c fs: move file_start_write() into direct_splice_actor() 2023-12-01 11:39:50 +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 fs: move kiocb_start_write() into vfs_iocb_iter_write() 2023-11-24 10:37:44 +01: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