]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sunrpc: reset rq_accept_statp when starting a new RPC
authorJeff Layton <jlayton@kernel.org>
Fri, 20 Jun 2025 12:16:03 +0000 (08:16 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 14 Jul 2025 16:46:48 +0000 (12:46 -0400)
rq_accept_statp should point to the location of the accept_status in the
reply. This field is not reset between RPCs so if svc_authenticate or
pg_authenticate return SVC_DENIED without setting the pointer, it could
result in the status being written to the wrong place.

This pointer starts its lifetime as NULL. Reset it on every iteration
so we get consistent behavior if this happens.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/svc.c

index c6ceacedae28e2aafd15edd170a27cdaa84ec47f..b1fab3a6954437cf751e4725fa52cfc83eddf2ab 100644 (file)
@@ -1334,6 +1334,9 @@ svc_process_common(struct svc_rqst *rqstp)
        int                     pr, rc;
        __be32                  *p;
 
+       /* Reset the accept_stat for the RPC */
+       rqstp->rq_accept_statp = NULL;
+
        /* Will be turned off only when NFSv4 Sessions are used */
        set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
        clear_bit(RQ_DROPME, &rqstp->rq_flags);