From: NeilBrown Date: Fri, 28 Mar 2025 00:05:59 +0000 (+1100) Subject: nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request X-Git-Tag: v6.16-rc1~138^2~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1244f0b2c3cecd3f349a877006e67c9492b41807;p=thirdparty%2Fkernel%2Flinux.git nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request If the request being processed is not a v4 compound request, then examining the cstate can have undefined results. This patch adds a check that the rpc procedure being executed (rq_procinfo) is the NFSPROC4_COMPOUND procedure. Reported-by: Olga Kornievskaia Cc: stable@vger.kernel.org Reviewed-by: Jeff Layton Signed-off-by: NeilBrown Signed-off-by: Chuck Lever --- diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index f5a06912ff8c4..77895e0996736 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -3777,7 +3777,8 @@ bool nfsd4_spo_must_allow(struct svc_rqst *rqstp) struct nfs4_op_map *allow = &cstate->clp->cl_spo_must_allow; u32 opiter; - if (!cstate->minorversion) + if (rqstp->rq_procinfo != &nfsd_version4.vs_proc[NFSPROC4_COMPOUND] || + cstate->minorversion == 0) return false; if (cstate->spo_must_allowed)