summaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorXingyuan Mo <hdthky0@gmail.com>2023-01-11 17:24:53 +0100
committerChuck Lever <chuck.lever@oracle.com>2023-01-12 03:29:11 +0100
commite6cf91b7b47ff82b624bdfe2fdcde32bb52e71dd (patch)
treed3c42d05235a0fdfa5a1c4172e40167279ef9f66 /fs/nfsd
parentNFSD: Use set_bit(RQ_DROPME) (diff)
downloadlinux-e6cf91b7b47ff82b624bdfe2fdcde32bb52e71dd.tar.xz
linux-e6cf91b7b47ff82b624bdfe2fdcde32bb52e71dd.zip
NFSD: fix use-after-free in nfsd4_ssc_setup_dul()
If signal_pending() returns true, schedule_timeout() will not be executed, causing the waiting task to remain in the wait queue. Fixed by adding a call to finish_wait(), which ensures that the waiting task will always be removed from the wait queue. Fixes: f4e44b393389 ("NFSD: delay unmount source's export after inter-server copy completed.") Signed-off-by: Xingyuan Mo <hdthky0@gmail.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4proc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 9b81d012666e..f189ba7995f5 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1318,6 +1318,7 @@ try_again:
/* allow 20secs for mount/unmount for now - revisit */
if (signal_pending(current) ||
(schedule_timeout(20*HZ) == 0)) {
+ finish_wait(&nn->nfsd_ssc_waitq, &wait);
kfree(work);
return nfserr_eagain;
}