NFSD: fix use-after-free in nfsd4_ssc_setup_dul()
authorXingyuan Mo <hdthky0@gmail.com>
Wed, 11 Jan 2023 16:24:53 +0000 (00:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:27:07 +0000 (08:27 +0100)
commit0a27dcd5343026ac0cb168ee63304255372b7a36
treec91ff595e0480b901744e90f75e9395f452f0129
parent24af570c99b4d249907bdb29fb8c16c7f7f82866
NFSD: fix use-after-free in nfsd4_ssc_setup_dul()

[ Upstream 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 <hdthky0@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4proc.c