From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 802D53597E; Mon, 23 Jun 2025 22:07:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750716451; cv=none; b=HEo5qhHzbVPJpHfCcIlsDObQht1/q4oy8ufhaRDnrNB3Wkl999iGhkFuPmbhmQNkvDh16E+xJo/0/EydrHsjLKCRqHp8OpXMXZLc2qzfMTG9cENKed1cuKTIeYGWbSu4r7Rk/tuZXxWd+768llBssyVYtvXwzwFYG3Iwe7IXuug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750716451; c=relaxed/simple; bh=e5u9bZbULRF+F4IoTJIW5Xq1ijlvAygB3Erz2a9bFQo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WcphBUB/Hbup3b7Vhunw7vD/F4m8soHj0IbQvPqUv6nqs48eIQRdXUrQfYCzox+B3gfAaDDbZt9oKUoovYlElWKKa3ju0HvJZtFjnidqSzpElMNF4Q4Uy1WxeUG7IbQCdc8MY53cZlLB4CMk9s/CSG1i9R0fEg78XikcSpXoZk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wfgQBrCk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wfgQBrCk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1712CC4CEEA; Mon, 23 Jun 2025 22:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750716451; bh=e5u9bZbULRF+F4IoTJIW5Xq1ijlvAygB3Erz2a9bFQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wfgQBrCk0ikpfSylnjgYerzPFcSSQ81lFVMBhunrTTDIlC9WGv+uCboDw1IkWWnl8 lTQcTAcv77dofhDngplrSdrvCn2XzheNqpjuY9+arMHtDsW0mdZxZUch17YI4bdeC+ GBEB+RRz0GDsTeCca26+X9q8cJsq8EauqxY21E+c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Olga Kornievskaia , Jeff Layton , NeilBrown , Chuck Lever Subject: [PATCH 6.1 303/508] nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request Date: Mon, 23 Jun 2025 15:05:48 +0200 Message-ID: <20250623130652.759414416@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130645.255320792@linuxfoundation.org> References: <20250623130645.255320792@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: NeilBrown 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 --- fs/nfsd/nfs4proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -3536,7 +3536,8 @@ bool nfsd4_spo_must_allow(struct svc_rqs 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)