]> git.baikalelectronics.ru Git - 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)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 22 Jul 2020 20:47:14 +0000 (16:47 -0400)
commit885aed46992388be63fc23d4a16d76b9cdcda678
treecdbc309d8b515f478f1595b617911b84141bc028
parent06d1bb98f0de04d4e3bb911b6587cdc58b97e36e
nfsd4: fix NULL dereference in nfsd/clients display code

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: 4d7368eabbcf ("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>
fs/nfsd/nfs4state.c