Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Parri <parri.andrea@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Andrea Parri <parri.andrea@gmail.com>,
	Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Damien Le Moal <dlemoal@kernel.org>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] nvmet: zns: reject a NUMD whose byte count wraps
Date: Wed, 14 Oct 2026 13:00:52 +0200	[thread overview]
Message-ID: <20261014110053.95249-1-parri.andrea@gmail.com> (raw)
In-Reply-To: <20261013142649.GD14759@lst.de>

On Tue, Oct 13, 2026 at 04:26:49PM +0200, Christoph Hellwig wrote:
> > +	/* From U32_MAX / 4 up, the byte count wraps and no longer matches NUMD. */
> 
> Overly long line here.
> 
> > +	if (numd >= U32_MAX / 4 ||
> > +	    out_bufsize < sizeof(struct nvme_zone_report)) {
> 
> I guess to make various sanitizers happy we probably should only
> calculate out_bufsize after bounds checking numd?

Agreed.  For v2 I plan to move the check to the start of
nvmet_bdev_execute_zone_mgmt_recv(), before the handler or its work item
computes (numd + 1) << 2, and to make nvmet_io_cmd_transfer_len() return
0 for such a NUMD, so pci-epf doesn't compute it either.  I'll also keep
the comments within 80 columns.

Thanks,
Andrea


  reply	other threads:[~2026-10-14 11:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 14:12 [PATCH 0/5] nvmet: fix stale data exposure and ZNS validation Andrea Parri
2026-10-12 14:12 ` [PATCH 1/5] nvmet-fc: only send read data for successful commands Andrea Parri
2026-10-12 14:12 ` [PATCH 2/5] nvmet: zns: don't leak stale memory in zone management receive Andrea Parri
2026-10-13 14:25   ` Christoph Hellwig
2026-10-14 11:00     ` Andrea Parri
2026-10-14 13:04       ` Christoph Hellwig
2026-10-14 17:05         ` Andrea Parri
2026-10-13 15:47   ` Keith Busch
2026-10-12 14:12 ` [PATCH 3/5] nvmet: zns: reject a NUMD whose byte count wraps Andrea Parri
2026-10-13 14:26   ` Christoph Hellwig
2026-10-14 11:00     ` Andrea Parri [this message]
2026-10-12 14:12 ` [PATCH 4/5] nvmet: pci-epf: report transport errors in command completions Andrea Parri
2026-10-13 14:27   ` Christoph Hellwig
2026-10-13 15:12     ` Damien Le Moal
2026-10-14 11:01       ` Andrea Parri
2026-10-14 12:46       ` Niklas Cassel
2026-10-12 14:12 ` [PATCH 5/5] nvmet: pci-epf: require SGLs to match the command data length Andrea Parri
2026-10-13 14:28   ` Christoph Hellwig
2026-10-14 12:47     ` Niklas Cassel

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=20261014110053.95249-1-parri.andrea@gmail.com \
    --to=parri.andrea@gmail.com \
    --cc=dlemoal@kernel.org \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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