[PATCH 1/2] nvme: bound ns descriptor header and body to identify buffer

Christoph Hellwig hch at lst.de
Sun Jul 12 23:42:23 PDT 2026


On Thu, Jul 09, 2026 at 02:30:32PM +0200, Greg Kroah-Hartman wrote:
> From: Hari Mishal <harimishal1 at gmail.com>
> 
> nvme_identify_ns_descs() allocates a buffer and gives it to the
> controller, which populates it and then iterates the buffer with
> variable byte increments that vary by type and body size.  But, there is
> no bounds check inside the iteration itself except the loop bound
> itself.  Fix this by checking and stopping iteration if the next header
> or its declared body would go past the buffer itself.

Looks good:

Reviewed-by: Christoph Hellwig <hch at lst.de>




More information about the Linux-nvme mailing list