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

* Re: [PATCH] nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2025-04-08 14:19 UTC (permalink / raw)
  To: NeilBrown, Chuck Lever, Olga Kornievskaia; +Cc: linux-nfs

On Fri, 2025-03-28 at 11:05 +1100, NeilBrown wrote:
> 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)

Reviewed-by: Jeff Layton <jlayton@kernel.org>

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

* Re: [PATCH] nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request
  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
  1 sibling, 0 replies; 3+ messages in thread
From: cel @ 2025-04-10 14:29 UTC (permalink / raw)
  To: Jeff Layton, Olga Kornievskaia, NeilBrown; +Cc: Chuck Lever, linux-nfs

From: Chuck Lever <chuck.lever@oracle.com>

On Fri, 28 Mar 2025 11:05:59 +1100, NeilBrown wrote:
> 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.
> 
> 
> [...]

Applied to nfsd-testing, thanks!

[1/1] nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request
      commit: 2abb04fa48e2469247d2e3e05df8df9edd1fe402

--
Chuck Lever


^ permalink raw reply	[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