]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfsd: fix __fh_verify for localio
authorOlga Kornievskaia <okorniev@redhat.com>
Tue, 28 Jan 2025 16:58:06 +0000 (11:58 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:34:06 +0000 (16:34 +0200)
commit d9d6b74e4be989f919498798fa40df37a74b5bb0 upstream.

__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.

Fixes: eccbbc7c00a5 ("nfsd: don't use sv_nrthreads in connection limiting calculations.")
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfsfh.c

index a61d057878a06a7c160e75ef0340470052bedf83..a23759c59232009b726f8e79332a48905603a11f 100644 (file)
@@ -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);