[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251202055530.GA15852@lst.de>
Date: Tue, 2 Dec 2025 06:55:30 +0100
From: Christoph Hellwig <hch@....de>
To: Stefan Hajnoczi <stefanha@...hat.com>
Cc: Christoph Hellwig <hch@....de>, linux-block@...r.kernel.org,
Keith Busch <kbusch@...nel.org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
linux-kernel@...r.kernel.org,
"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
Mike Christie <michael.christie@...cle.com>,
linux-nvme@...ts.infradead.org, Jens Axboe <axboe@...nel.dk>,
linux-scsi@...r.kernel.org, Sagi Grimberg <sagi@...mberg.me>
Subject: Re: [PATCH v2 2/4] nvme: reject invalid pr_read_keys() num_keys
values
On Mon, Dec 01, 2025 at 11:22:55AM -0500, Stefan Hajnoczi wrote:
> > We use struct_size to calculate the size below, which saturates on
> > overflow. So just checking the rse_len variable returned by the that
> > would be nicer. Bonus points for using sizeof_field() instead of
> > hardcoding U32_MAX.
>
> Will fix. I don't see how to use sizeof_field() here, but taking
> advantage of struct_size() already improves things a lot:
I thought we'd stuff the len in some field, but we actually convert
it to the ndw in the command, so yes it doesn't make sense here.
Sorry for the misleading direction.
Powered by blists - more mailing lists