Re: [PATCH 05/11] block: Limit allocation of zone descriptors for report zones

2018-10-10 Thread Christoph Hellwig
> + 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)) > -

[PATCH 05/11] block: Limit allocation of zone descriptors for report zones

2018-10-09 Thread Damien Le Moal
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 ---