Skip to content

Commit e6cf91b

Browse files
hdthkychucklever
authored andcommitted
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: f4e44b3 ("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>
1 parent 5304930 commit e6cf91b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,7 @@ static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
13181318
/* allow 20secs for mount/unmount for now - revisit */
13191319
if (signal_pending(current) ||
13201320
(schedule_timeout(20*HZ) == 0)) {
1321+
finish_wait(&nn->nfsd_ssc_waitq, &wait);
13211322
kfree(work);
13221323
return nfserr_eagain;
13231324
}

0 commit comments

Comments
 (0)