Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request
@ 2025-03-28  0:05 NeilBrown
  2025-04-08 14:19 ` Jeff Layton
  2025-04-10 14:29 ` cel
  0 siblings, 2 replies; 3+ messages in thread
From: NeilBrown @ 2025-03-28  0:05 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton, Olga Kornievskaia; +Cc: linux-nfs


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 execute
(rq_procinfo) is the NFSPROC4_COMPOUND procedure.

Reported-by: Olga Kornievskaia <okorniev@redhat.com>
Signed-off-by: NeilBrown <neil@brown.name>
---
 fs/nfsd/nfs4proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 5860f3825be2..7295776b4ccb 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -3768,7 +3768,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)
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-10 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28  0:05 [PATCH] nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request NeilBrown
2025-04-08 14:19 ` Jeff Layton
2025-04-10 14:29 ` cel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox