> + unsigned int nr_zones;
> int ret;
>
> if (!argp)
> @@ -355,8 +356,9 @@ int blkdev_report_zones_ioctl(struct block_device *bdev,
> fmode_t mode,
> if (!rep.nr_zones)
> return -EINVAL;
>
> - if (rep.nr_zones > INT_MAX / sizeof(struct blk_zone))
> -
There is no point in allocating more zone descriptors than the number of
zones a block device has for doing a zone report. Avoid doing that in
blkdev_report_zones_ioctl() by limiting the number of zone decriptors
allocated internally to process the user request.
Signed-off-by: Damien Le Moal
---
2 matches
Mail list logo