]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfsd: avoid a NULL dereference in __cld_pipe_upcall()
authorScott Mayhew <smayhew@redhat.com>
Fri, 10 Jul 2020 20:33:07 +0000 (16:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:09 +0000 (08:24 +0200)
commitb88fd43a6dfc716aa6c700857c5e35f21fc8d3a9
tree2a625852710f47a2b75f716f11343967ce25901a
parent196dae5b82d136986fadf669a66d64eaf29f9a2a
nfsd: avoid a NULL dereference in __cld_pipe_upcall()

[ Upstream commit df60446cd1fb487becd1f36f4c0da9e0e523c0cf ]

If the rpc_pipefs is unmounted, then the rpc_pipe->dentry becomes NULL
and dereferencing the dentry->d_sb will trigger an oops.  The only
reason we're doing that is to determine the nfsd_net, which could
instead be passed in by the caller.  So do that instead.

Fixes: 11a60d159259 ("nfsd: add a "GetVersion" upcall for nfsdcld")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4recover.c