]> git.ipfire.org Git - people/arne_f/kernel.git/commit
nfsd4: fix NULL dereference in nfsd/clients display code
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 15 Jul 2020 17:31:36 +0000 (13:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:47 +0000 (10:19 +0200)
commit3c177b914ad7787654545e157d63745383a22702
treee13cceb3d78a93152b1d0909c08d0bd63e6ede1e
parente0b8a866eba09fceea7bab7732eee7ad1077732e
nfsd4: fix NULL dereference in nfsd/clients display code

[ Upstream commit 9affa435817711861d774f5626c393c80f16d044 ]

We hold the cl_lock here, and that's enough to keep stateid's from going
away, but it's not enough to prevent the files they point to from going
away.  Take fi_lock and a reference and check for NULL, as we do in
other code.

Reported-by: NeilBrown <neilb@suse.de>
Fixes: 78599c42ae3c ("nfsd4: add file to display list of client's opens")
Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4state.c