linux-stable/include
Trond Myklebust 181feb41f0 NFS: Fix a race when updating an existing write
commit 76d2e3890f upstream.

After nfs_lock_and_join_requests() tests for whether the request is
still attached to the mapping, nothing prevents a call to
nfs_inode_remove_request() from succeeding until we actually lock the
page group.
The reason is that whoever called nfs_inode_remove_request() doesn't
necessarily have a lock on the page group head.

So in order to avoid races, let's take the page group lock earlier in
nfs_lock_and_join_requests(), and hold it across the removal of the
request in nfs_inode_remove_request().

Reported-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Joe Quanaim <jdq@meta.com>
Tested-by: Andrew Steffen <aksteffen@meta.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Fixes: bd37d6fce1 ("NFSv4: Convert nfs_lock_and_join_requests() to use nfs_page_find_head_request()")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-04 15:30:20 +02:00
..
acpi ACPICA: Avoid sequence overread in call to strncmp() 2025-06-27 11:08:52 +01:00
asm-generic
clocksource
crypto
drm drm/framebuffer: Acquire internal references on GEM handles 2025-07-17 18:35:14 +02:00
dt-bindings
keys
kunit
kvm
linux NFS: Fix a race when updating an existing write 2025-09-04 15:30:20 +02:00
math-emu
media
memory
misc
net bonding: Add independent control state machine 2025-08-28 16:28:49 +02:00
pcmcia
ras
rdma
rv
scsi
soc
sound
target
trace btrfs: constify more pointer parameters 2025-08-28 16:28:41 +02:00
uapi bonding: Add independent control state machine 2025-08-28 16:28:49 +02:00
ufs scsi: ufs: core: Add OPP support for scaling clocks and regulators 2025-07-10 16:03:14 +02:00
vdso
video
xen