2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/fs/fuse
Miklos Szeredi b4c173dfbb
fuse: don't truncate cached, mutated symlink
Fuse allows the value of a symlink to change and this property is exploited
by some filesystems (e.g. CVMFS).

It has been observed, that sometimes after changing the symlink contents,
the value is truncated to the old size.

This is caused by fuse_getattr() racing with fuse_reverse_inval_inode().
fuse_reverse_inval_inode() updates the fuse_inode's attr_version, which
results in fuse_change_attributes() exiting before updating the cached
attributes

This is okay, as the cached attributes remain invalid and the next call to
fuse_change_attributes() will likely update the inode with the correct
values.

The reason this causes problems is that cached symlinks will be
returned through page_get_link(), which truncates the symlink to
inode->i_size.  This is correct for filesystems that don't mutate
symlinks, but in this case it causes bad behavior.

The solution is to just remove this truncation.  This can cause a
regression in a filesystem that relies on supplying a symlink larger than
the file size, but this is unlikely.  If that happens we'd need to make
this behavior conditional.

Reported-by: Laura Promberger <laura.promberger@cern.ch>
Tested-by: Sam Lewis <samclewis@google.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Link: https://lore.kernel.org/r/20250220100258.793363-1-mszeredi@redhat.com
Reviewed-by: Bernd Schubert <bschubert@ddn.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-02-20 15:48:17 +01:00
..
acl.c fuse: support idmapped ->set_acl 2024-09-04 16:51:11 +02:00
control.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
cuse.c fuse: remove pages for requests and exclusively use folios 2024-11-05 14:08:35 +01:00
dax.c fuse: make args->in_args[0] to be always the header 2025-01-24 11:54:02 +01:00
dev_uring_i.h fuse: {io-uring} Prevent mount point hang on fuse-server termination 2025-01-27 18:02:21 +01:00
dev_uring.c fuse: prevent disabling io-uring on active connections 2025-01-27 18:02:23 +01:00
dev.c fuse: revert back to __readahead_folio() for readahead 2025-02-14 10:49:23 +01:00
dir.c fuse: don't truncate cached, mutated symlink 2025-02-20 15:48:17 +01:00
file.c fuse: revert back to __readahead_folio() for readahead 2025-02-14 10:49:23 +01:00
fuse_dev_i.h fuse: {io-uring} Make fuse_dev_queue_{interrupt,forget} non-static 2025-01-27 18:01:22 +01:00
fuse_i.h fuse: block request allocation until io-uring init is complete 2025-01-27 18:02:23 +01:00
fuse_trace.h fuse: add simple request tracepoints 2024-08-29 11:43:13 +02:00
inode.c fuse: block request allocation until io-uring init is complete 2025-01-27 18:02:23 +01:00
ioctl.c fuse: remove pages for requests and exclusively use folios 2024-11-05 14:08:35 +01:00
iomode.c fuse: fix parallel dio write on file open in passthrough mode 2024-04-15 10:12:44 +02:00
Kconfig fuse: {io-uring} Handle SQEs - register commands 2025-01-24 11:54:08 +01:00
Makefile fuse: {io-uring} Handle SQEs - register commands 2025-01-24 11:54:08 +01:00
passthrough.c backing-file: clean up the API 2024-11-11 10:45:03 +01:00
readdir.c fuse: check attributes staleness on fuse_iget() 2024-11-18 12:24:13 +01:00
sysctl.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
virtio_fs.c virtio: features, fixes, cleanups 2024-11-27 13:11:58 -08:00
xattr.c fuse: make args->in_args[0] to be always the header 2025-01-24 11:54:02 +01:00