Skip to content

Commit e2655c1

Browse files
J. Bruce Fieldsgregkh
authored andcommitted
nfsd: fix oops on mixed NFSv4/NFSv3 client access
[ Upstream commit 34b09af ] 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: 28df3d1 ("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>
1 parent ccba367 commit e2655c1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/nfsd/nfs4state.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4597,6 +4597,8 @@ static bool nfsd_breaker_owns_lease(struct file_lock *fl)
45974597
if (!i_am_nfsd())
45984598
return NULL;
45994599
rqst = kthread_data(current);
4600+
if (!rqst->rq_lease_breaker)
4601+
return NULL;
46004602
clp = *(rqst->rq_lease_breaker);
46014603
return dl->dl_stid.sc_client == clp;
46024604
}

0 commit comments

Comments
 (0)