]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
NFSD: Make nfsd_genl_rqstp::rq_ops array best-effort
authorChuck Lever <chuck.lever@oracle.com>
Tue, 10 Jun 2025 16:05:08 +0000 (12:05 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 14 Jul 2025 16:46:41 +0000 (12:46 -0400)
To enable NFSD to handle NFSv4 COMPOUNDs of unrestricted size,
resize the array in struct nfsd_genl_rqstp so it saves only up to
16 operations per COMPOUND.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsctl.c
fs/nfsd/nfsd.h

index fcff2e010d416183d3b525c66c5d13df7b1f1863..2909d70de55994bdc32c0ab670e9a5626d58db33 100644 (file)
@@ -1569,7 +1569,8 @@ int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
                                int j;
 
                                args = rqstp->rq_argp;
-                               genl_rqstp.rq_opcnt = args->opcnt;
+                               genl_rqstp.rq_opcnt = min_t(u32, args->opcnt,
+                                                           ARRAY_SIZE(genl_rqstp.rq_opnum));
                                for (j = 0; j < genl_rqstp.rq_opcnt; j++)
                                        genl_rqstp.rq_opnum[j] =
                                                args->ops[j].opnum;
index 1bfd0b4e9af7b84d98c27abc04741d7eae126cfa..570065285e67f8101fa7483df36c75ba7eebac34 100644 (file)
@@ -72,7 +72,7 @@ struct nfsd_genl_rqstp {
 
        /* NFSv4 compound */
        u32                     rq_opcnt;
-       u32                     rq_opnum[NFSD_MAX_OPS_PER_COMPOUND];
+       u32                     rq_opnum[16];
 };
 
 extern struct svc_program      nfsd_programs[];