Re: [PATCH v3] block: add allocation size check in blkdev_pr_read_keys()

From: Martin K. Petersen
Date: Wed Dec 17 2025 - 09:27:21 EST



Deepanshu,

> blkdev_pr_read_keys() takes num_keys from userspace and uses it to
> calculate the allocation size for keys_info via struct_size(). While
> there is a check for SIZE_MAX (integer overflow), there is no upper
> bound validation on the allocation size itself.

LGTM.

Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>

--
Martin K. Petersen