Christoph Hellwig 6c6b354914 block: set the zone size in blk_revalidate_disk_zones atomically
The current zone revalidation code has a major problem in that it
doesn't update the zone size and q->nr_zones atomically, leading
to a short window where an out of bounds access to the zone arrays
is possible.

To fix this move the setting of the zone size into the crticial
sections blk_revalidate_disk_zones so that it gets updated together
with the zone bitmaps and q->nr_zones.  This also slightly simplifies
the caller as it deducts the zone size from the report_zones.

This change also allows to check for a power of two zone size in generic
code.

Reported-by: Hans Holmberg <hans@owltronix.com>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-03 10:18:22 -07:00
..
2019-07-11 15:14:01 -07:00
2019-10-05 12:53:27 -07:00
2019-07-11 15:14:01 -07:00
2019-11-07 06:43:18 -07:00
2019-09-21 10:50:15 -07:00
2019-09-21 10:50:15 -07:00
2019-11-07 06:43:18 -07:00
2019-09-23 19:16:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:17:41 -07:00
2019-10-05 12:53:27 -07:00
2019-08-29 18:31:39 -04:00
2019-11-07 06:43:18 -07:00
2019-03-02 11:39:54 -08:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2018-06-19 22:02:25 -04:00
2018-12-18 23:19:21 -05:00
2019-07-11 15:17:41 -07:00
2019-01-08 21:58:35 -05:00
2019-01-08 21:58:35 -05:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:14:01 -07:00
2019-11-07 06:43:18 -07:00
2019-06-18 19:46:18 -04:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2018-12-18 23:19:21 -05:00
2018-11-06 21:31:28 -05:00
2019-11-07 06:43:18 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:17:41 -07:00
2018-12-28 14:48:06 -08:00
2019-05-20 10:56:43 -04:00
2019-07-11 15:17:41 -07:00
2019-08-16 11:33:56 -07:00
2019-08-16 11:33:56 -07:00
2019-07-11 15:14:01 -07:00
2018-06-19 22:02:25 -04:00
2019-11-12 19:12:07 -07:00
2019-07-11 15:14:01 -07:00
2018-12-18 23:19:21 -05:00
2019-05-21 06:16:23 -04:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:14:01 -07:00