[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251202055831.GA15965@lst.de>
Date: Tue, 2 Dec 2025 06:58:31 +0100
From: Christoph Hellwig <hch@....de>
To: Stefan Hajnoczi <stefanha@...hat.com>
Cc: linux-block@...r.kernel.org, Christoph Hellwig <hch@....de>,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Sagi Grimberg <sagi@...mberg.me>,
Mike Christie <michael.christie@...cle.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
linux-nvme@...ts.infradead.org
Subject: Re: [PATCH v3 1/4] scsi: sd: reject invalid pr_read_keys()
num_keys values
On Mon, Dec 01, 2025 at 04:43:26PM -0500, Stefan Hajnoczi wrote:
> + /*
> + * Each reservation key takes 8 bytes and there is an 8-byte header
> + * before the reservation key list. The total size must fit into the
> + * 16-bit ALLOCATION LENGTH field.
> + */
> + if (check_mul_overflow(num_keys, 8, &data_len) ||
> + check_add_overflow(data_len, 8, &data_len) ||
Using data_len for the throw away key size is a little confusing,
but then again I guess compared to all the surrounding code that's
harmless :)
So:
Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists