Thread (19 messages) 19 messages, 4 authors, 2025-12-02

Re: [PATCH v2 2/4] nvme: reject invalid pr_read_keys() num_keys values

From: Christoph Hellwig <hch@lst.de>
Date: 2025-12-02 05:55:34
Also in: linux-nvme, linux-scsi, lkml

On Mon, Dec 01, 2025 at 11:22:55AM -0500, Stefan Hajnoczi wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help