From: Christoph Hellwig <hch@lst.de>
To: Werner Kasselman <werner@verivus.ai>
Cc: Trond Myklebust <trondmy@kernel.org>,
Anna Schumaker <anna@kernel.org>, Christoph Hellwig <hch@lst.de>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 1/2] pnfs/blocklayout: validate volume indices and limit recursion depth
Date: Thu, 23 Apr 2026 07:15:17 +0200 [thread overview]
Message-ID: <20260423051517.GC27929@lst.de> (raw)
In-Reply-To: <20260421100338.1227152-2-werner@verivus.com>
On Tue, Apr 21, 2026 at 10:03:42AM +0000, Werner Kasselman wrote:
> #define PNFS_BLOCK_MAX_UUIDS 4
> #define PNFS_BLOCK_MAX_DEVICES 64
> +#define PNFS_BLOCK_MAX_DEPTH 16
I think we can and should reduce the nesting depth. The only really
useful nesting is mirroring + striping or concatenation. Giving a little
extra slack is fine, but I think 4 (or 8 if you insist) should be
enough,
> + int depth, gfp_t gfp_mask);
unsigned?
> default:
> @@ -559,6 +581,9 @@ bl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
> goto out_free_scratch;
> nr_volumes = be32_to_cpup(p++);
>
> + if (nr_volumes <= 0)
> + goto out_free_scratch;
nr_volumes should be siwtched to an unsigned value, as it is over
the wire.
Otherwise looks good, thanks a lot!
next prev parent reply other threads:[~2026-04-23 5:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 10:03 [PATCH 0/2] pnfs/blocklayout: harden GETDEVICEINFO volume parser Werner Kasselman
2026-04-21 10:03 ` [PATCH 1/2] pnfs/blocklayout: validate volume indices and limit recursion depth Werner Kasselman
2026-04-23 5:15 ` Christoph Hellwig [this message]
2026-04-21 10:03 ` [PATCH 2/2] pnfs/blocklayout: cap total parse operations in volume topology Werner Kasselman
2026-04-23 5:18 ` Christoph Hellwig
2026-04-23 5:20 ` [PATCH 0/2] pnfs/blocklayout: harden GETDEVICEINFO volume parser Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260423051517.GC27929@lst.de \
--to=hch@lst.de \
--cc=anna@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=trondmy@kernel.org \
--cc=werner@verivus.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox