]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFS: Pin the 'struct nfs_server' during a FREE_STATEID call
authorAnna Schumaker <anna.schumaker@hammerspace.com>
Tue, 30 Jun 2026 18:31:00 +0000 (14:31 -0400)
committerAnna Schumaker <anna.schumaker@hammerspace.com>
Mon, 20 Jul 2026 15:03:56 +0000 (11:03 -0400)
commitcf616096a0f3a2b60f7d68b6b39674a6867ded9c
treeae31448634292eaefd68bd0ae4d9c541c9a485b0
parent1590cf0329716306e948a8fc29f1d3ee87d3989f
NFS: Pin the 'struct nfs_server' during a FREE_STATEID call

Dan Aloni reports that he was able to hit a use-after-free bug if a
FREE_STATEID operation gets delayed for whatever reason. Fix this by
bumping the refcount of the 'struct nfs_server' object for the duration
of the FREE_STATEID so it doesn't get cleaned up from underneath us
while operations are still in flight.

Reported-by: Dan Aloni <dan.aloni@vastdata.com>
Fixes: 7c1d5fae4a87 ("NFSv4: Convert nfs41_free_stateid to use an asynchronous RPC call")
Tested-by: Dan Aloni <dan.aloni@vastdata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
fs/nfs/nfs4proc.c