nfsd: fix oops on mixed NFSv4/NFSv3 client access
Subsystems (2)
PATCH 1/1 nfsd: fix oops on mixed NFSv4/NFSv3 client access
From: "J. Bruce Fields" <[email protected]>
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
--- fs/nfsd/nfs4state.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfsd/nfs4state.c +2 -0
@@ -4597,6 +4597,8 @@ static bool nfsd_breaker_owns_lease(struct file_lock *fl)if (!i_am_nfsd ())return NULL ; rqst =kthread_data (current); +if (!rqst->rq_lease_breaker) +return NULL ; clp = *(rqst->rq_lease_breaker);return dl->dl_stid.sc_client == clp; }
Signature · 1 line
2.26.2
Hi Bruce-
Quoted 9 lines · On Aug 5, 2020, at 3:10 PM, [email protected] wrote:
From: "J. Bruce Fields" <[email protected]>
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
Quoted 7 lines
mount -overs=4.2 server:/export
/mnt/
sleep 1h </mnt/file&
mount -overs=3 server:/export /mnt2/
touch /mnt2/fileReported-by Robert Dinse <[email protected]>Fixes 28df3d1539de50 ("nfsd: clients don't need to break their own delegations")
May I add
And send this in the first NFSD v5.9 -rc pull request?
Quoted 21 lines
Signed-off-by J. Bruce Fields <[email protected]>---
fs/nfsd/nfs4state.c| 2 ++1 file changed, 2 insertions(+)fs/nfsd/nfs4state.c +2
-0@@ -4597,6 +4597,8 @@ static bool nfsd_breaker_owns_lease(struct file_lock *fl)if (!i_am_nfsd ())return NULL ; rqst =kthread_data (current); +if (!rqst->rq_lease_breaker) +return NULL ; clp = *(rqst->rq_lease_breaker);return dl->dl_stid.sc_client == clp; }Signature · 1 line
2.26.2
--
Chuck Lever
Quoted 16 lines · Chuck Lever
Hi Bruce-
Quoted 14 lines · On Aug 5, 2020, at 3:10 PM, [email protected] wrote:
From: "J. Bruce Fields" <[email protected]>
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
Quoted 8 lines
Quoted 2 lines
Reported-by Robert Dinse <[email protected]>Fixes 28df3d1539de50 ("nfsd: clients don't need to break their own delegations")May I add
And send this in the first NFSD v5.9 -rc pull request?
Sounds good, thanks!
--b.
Quoted 28 lines
Quoted 23 lines
Signed-off-by J. Bruce Fields <[email protected]>---
fs/nfsd/nfs4state.c| 2 ++1 file changed, 2 insertions(+)fs/nfsd/nfs4state.c +2
-0@@ -4597,6 +4597,8 @@ static bool nfsd_breaker_owns_lease(struct file_lock *fl)if (!i_am_nfsd ())return NULL ; rqst =kthread_data (current); +if (!rqst->rq_lease_breaker) +return NULL ; clp = *(rqst->rq_lease_breaker);return dl->dl_stid.sc_client == clp; }Signature · 1 line
2.26.2--
Chuck Lever