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: v5.10.239~187 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1d0323a09a29f81572c7391e0d80d78724729c9;p=thirdparty%2Fkernel%2Fstable.git nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request commit 1244f0b2c3cecd3f349a877006e67c9492b41807 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 8cf0e4e62bc84..1da06a15b13f5 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -3537,7 +3537,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)