From c2476775680734293d17d1c11e943016487c56a1 Mon Sep 17 00:00:00 2001 From: Anmol Jain Date: Wed, 6 Aug 2025 11:13:34 +0000 Subject: [PATCH] NFSD: fix use-after-free in nfsd4_ssc_setup_dul() jira VULN-8056 cve CVE-2023-1652 commit-author Xingyuan Mo commit e6cf91b7b47ff82b624bdfe2fdcde32bb52e71dd 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 Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever (cherry picked from commit e6cf91b7b47ff82b624bdfe2fdcde32bb52e71dd) Signed-off-by: Anmol Jain --- fs/nfsd/nfs4proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index b7647fe1fcfba..1666ac21987e2 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1328,6 +1328,7 @@ static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr, /* 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; }