OSDN Git Service

nfsd4: fix crash on writing v4_end_grace before nfsd startup
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 27 Nov 2018 20:54:17 +0000 (15:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:44:53 +0000 (19:44 +0100)
commit60846115bbedc018f66dbdee61f5880c96ca15ad
tree4fb0884f7d7669d6b740a400d48a5c4cd717e41f
parentfa24ad75cfafdc4bdf4f947d25b1af438e70f1c6
nfsd4: fix crash on writing v4_end_grace before nfsd startup

[ Upstream commit 62a063b8e7d1db684db3f207261a466fa3194e72 ]

Anatoly Trosinenko reports that this:

1) Checkout fresh master Linux branch (tested with commit e195ca6cb)
2) Copy x84_64-config-4.14 to .config, then enable NFS server v4 and build
3) From `kvm-xfstests shell`:

results in NULL dereference in locks_end_grace.

Check that nfsd has been started before trying to end the grace period.

Reported-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfsctl.c