1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/include
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
..
acpi LoongArch changes for v6.14 2025-01-28 08:52:01 -08:00
asm-generic kbuild: keep symbols for symbol_get() even with CONFIG_TRIM_UNUSED_KSYMS 2025-02-06 01:08:58 +09:00
clocksource KVM/arm64 updates for 6.14 2025-01-28 09:01:36 -08:00
crypto crypto: skcipher - document skcipher_walk_done() and rename some vars 2025-01-14 11:38:32 +08:00
cxl cxl/events: Update Memory Module Event Record to CXL spec rev 3.1 2025-01-13 09:33:21 -07:00
drm drm: Fix DSC BPP increment decoding 2025-02-13 10:20:30 +02:00
dt-bindings dt-bindings: clock: qcom: Add CAMCC clocks for QCS8300 2025-02-02 20:59:04 -06:00
hyperv hyperv: Add new Hyper-V headers in include/hyperv 2025-01-10 00:54:20 +00:00
keys keys: drop shadowing dead prototype 2025-01-21 11:25:23 +02:00
kunit linux_kselftest-kunit-6.14-rc1 2025-01-22 12:32:39 -08:00
kvm Merge branch kvm-arm64/pkvm-memshare-declutter into kvmarm-master/next 2025-01-17 11:05:18 +00:00
linux fuse: don't truncate cached, mutated symlink 2025-02-20 15:48:17 +01:00
math-emu
media media: cec: include linux/debugfs.h and linux/seq_file.h where needed 2025-01-07 12:21:38 +01:00
memory
misc
net Bluetooth: L2CAP: Fix corrupted list in hci_chan_del 2025-02-13 11:15:37 -05:00
pcmcia
ras
rdma RDMA/core: Support link status events dispatching 2024-12-24 05:22:18 -05:00
rv rv: Reset per-task monitors also for idle tasks 2025-01-23 12:16:04 -05:00
scsi Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
soc soc: driver updates for 6.14 2025-01-24 14:56:59 -08:00
sound sound updates for 6.14-rc1 2025-01-24 07:54:34 -08:00
target
trace netfs: Fix a number of read-retry hangs 2025-02-13 16:00:38 +01:00
uapi Thermal control fixes for 6.14-rc3 2025-02-14 15:07:11 -08:00
ufs scsi: ufs: core: Fix use-after free in init error and remove paths 2025-02-03 17:20:01 -05:00
vdso vdso: Correct typo in PAGE_SHIFT comment 2025-01-15 11:07:08 +01:00
video
xen