nfsd: fix oops on mixed NFSv4/NFSv3 client access
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 5 Aug 2020 19:10:11 +0000 (15:10 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:26 +0000 (11:29 +0200)
commite2655c17ee2e5118cd41e394c3c4dc8e07caaee8
tree18333b1db22e783214e3e58da0bca352f0c66169
parentccba36760ca36365ffee5c44d7a2208169700568
nfsd: fix oops on mixed NFSv4/NFSv3 client access

[ Upstream commit 34b09af4f54e6485e28f138ccad159611a240cc1 ]

If an NFSv2/v3 client breaks an NFSv4 client's delegation, it will hit a
NULL dereference in nfsd_breaker_owns_lease().

Easily reproduceable with for example

mount -overs=4.2 server:/export /mnt/
sleep 1h </mnt/file &
mount -overs=3 server:/export /mnt2/
touch /mnt2/file

Reported-by: Robert Dinse <nanook@eskimo.com>
Fixes: 28df3d1539de50 ("nfsd: clients don't need to break their own delegations")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208807
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4state.c