[PATCH v2] nvme: fix memory allocation in nvme_pr_read_keys()

Dan Carpenter dan.carpenter at linaro.org
Sat Mar 21 00:19:14 PDT 2026


Ah, yes.  You're right.  It's the nonsense:

	if (rse_len > U32_MAX)
		return -EINVAL;

check which confused me.  Commit a58383fa45c7 ("block: add allocation
size check in blkdev_pr_read_keys()") caps num_keys at 65536 so the
rse_len can't be more than 4MB which is less than INT_MAX (2GB).  We
could remove that check.

I will send a patch to do that.

regards,
dan carpenter




More information about the Linux-nvme mailing list