Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
block: don't create too many partitions
Commit a33df75 ("block: use an xarray for disk->part_tbl") drops the check on max supported number of partitionsr, and allows partition with bigger partition numbers to be added. However, ->bd_partno is defined as u8, so partition index of xarray table may not match with ->bd_partno. Then delete_partition() may delete one unmatched partition, and caused use-after-free. Reviewed-by: Bart Van Assche <[email protected]> Reported-by: [email protected] Fixes: a33df75 ("block: use an xarray for disk->part_tbl") Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
- Loading branch information