[PATCH v4] nvme: nvme_identify_ns_descs: prevent oob

Christoph Hellwig hch at lst.de
Tue Dec 2 22:10:46 PST 2025


On Tue, Dec 02, 2025 at 09:22:13PM +0300, Eugene Korenevsky wrote:
> @@ -1563,11 +1564,14 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl,
>  		goto free_data;
>  	}
>  
> -	for (pos = 0; pos < NVME_IDENTIFY_DATA_SIZE; pos += len) {
> -		struct nvme_ns_id_desc *cur = data + pos;
> +	for (pos = 0; pos < NVME_IDENTIFY_DATA_SIZE - sizeof(*cur); pos += len) {

Please avoid the overly long line.

Otherwise this looks fine.




More information about the Linux-nvme mailing list