diff options
author | Li Nan <linan122@huawei.com> | 2023-12-19 15:59:42 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-12-19 08:23:12 -0700 |
commit | 4c434392c4777881d01beada6701eff8c76b43fe (patch) | |
tree | f23457479d752a1591637c20885909997931742e /LICENSES/preferred/LGPL-2.0 | |
parent | 6c9b97085c473e380e57cf33c95d2c74444b2a5d (diff) | |
download | linux-stable-4c434392c4777881d01beada6701eff8c76b43fe.tar.gz linux-stable-4c434392c4777881d01beada6701eff8c76b43fe.tar.bz2 linux-stable-4c434392c4777881d01beada6701eff8c76b43fe.zip |
block: add check of 'minors' and 'first_minor' in device_add_disk()
'first_minor' represents the starting minor number of disks, and
'minors' represents the number of partitions in the device. Neither
of them can be greater than MINORMASK + 1.
Commit e338924bd05d ("block: check minor range in device_add_disk()")
only added the check of 'first_minor + minors'. However, their sum might
be less than MINORMASK but their values are wrong. Complete the checks now.
Fixes: e338924bd05d ("block: check minor range in device_add_disk()")
Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231219075942.840255-1-linan666@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'LICENSES/preferred/LGPL-2.0')
0 files changed, 0 insertions, 0 deletions