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(+)
Oops, I've had this sitting around a couple weeks but I must have forgotten to send it in. This is needed for 5.9.
fs/nfsd/nfs4state.c +2 -0
@@ -4598,6 +4598,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
Quoted 11 lines · Bruce Fields
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 8 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")Signed-off-by J. Bruce Fields <[email protected]>
I think I've got this queued already. Is this different than:
http://git.linux-nfs.org/?p=cel/cel-2.6.git;a=commit;h=34b09af4f54e6485e28f138ccad159611a240cc1
Quoted 23 lines
---
fs/nfsd/nfs4state.c| 2 ++1 file changed, 2 insertions(+)Oops, I've had this sitting around a couple weeks but I must have forgotten to send it in. This is needed for 5.9.
fs/nfsd/nfs4state.c +2
-0@@ -4598,6 +4598,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
Quoted 16 lines · Bruce Fields
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 7 lines
Quoted 3 lines
Reported-by Robert Dinse <[email protected]>Fixes 28df3d1539de50 ("nfsd: clients don't need to break their own delegations")Signed-off-by J. Bruce Fields <[email protected]>I think I've got this queued already. Is this different than:
http://git.linux-nfs.org/?p=cel/cel-2.6.git;a=commit;h=34b09af4f54e6485e28f138ccad159611a240cc1
Oh, OK, great.--b.
Quoted 30 lines
Quoted 25 lines
---
fs/nfsd/nfs4state.c| 2 ++1 file changed, 2 insertions(+)Oops, I've had this sitting around a couple weeks but I must have forgotten to send it in. This is needed for 5.9.
fs/nfsd/nfs4state.c +2
-0@@ -4598,6 +4598,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