nfsd: fix __fh_verify for localio
Subsystems (2)
Olga Kornievskaia
reviewerPATCH 1/1 nfsd: fix __fh_verify for localio
__fh_verify() added a call to svc_xprt_set_valid() to help do connection management but during LOCALIO path rqstp argument is NULL, leading to NULL pointer dereferencing and a crash.
--- fs/nfsd/nfsfh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/nfsd/nfsfh.c +3 -2
@@ -381,8 +381,9 @@ __fh_verify(struct svc_rqst *rqstp, error =check_nfsd_access (exp, rqstp, may_bypass_gss);if (error) goto out; - -svc_xprt_set_valid (rqstp->rq_xprt); +/* During LOCALIO call to fh_verify will be called with a NULL rqstp */ +if (rqstp) +svc_xprt_set_valid (rqstp->rq_xprt);/* Finally, check access permissions. */ error =nfsd_permission (cred, exp, dentry, access);
Signature · 1 line
2.47.1
[email protected]
maintainerFrom: Chuck Lever <[email protected]>
Quoted 5 lines · Olga Kornievskaia
__fh_verify()added a call tosvc_xprt_set_valid()to help do connection management but during LOCALIO path rqstp argument is NULL, leading to NULL pointer dereferencing and a crash.
Applied to nfsd-testing, thanks!
[1/1] nfsd: fix __fh_verify for localio
commit: 3c6a376bcbc815e3bdae0816b32e600c4c63599e
--
Chuck Lever
Quoted 16 lines · Olga Kornievskaia
__fh_verify()added a call tosvc_xprt_set_valid()to help do connection management but during LOCALIO path rqstp argument is NULL, leading to NULL pointer dereferencing and a crash.Fixes eccbbc7c00a5 ("nfsd: don't use sv_nrthreads in connection limiting calculations.")Signed-off-by Olga Kornievskaia <[email protected]>--- fs/nfsd/nfsfh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)fs/nfsd/nfsfh.c +0
-0@@ -381,8 +381,9 @@ __fh_verify(struct svc_rqst *rqstp, error =check_nfsd_access (exp, rqstp, may_bypass_gss);
fs/nfsd/nfsfh.c __fh_verify(struct svc_rqst *rqstp, · line 389
Quoted 10 lines
fs/nfsd/nfsfh.c +3
-2if (error) goto out; - -svc_xprt_set_valid (rqstp->rq_xprt); +/* During LOCALIO call to fh_verify will be called with a NULL rqstp */ +if (rqstp) +svc_xprt_set_valid (rqstp->rq_xprt);/* Finally, check access permissions. */ error =nfsd_permission (cred, exp, dentry, access);
Nice catch!