nbd: Add the maximum limit of allocated index in nbd_dev_add
stable inclusion from stable-v4.19.291 commit 9441968ea6a9fe2343a9cc953cf53f8eac6174e1 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7ZELT CVE: NA -------------------------------- [ Upstream commit f12bc113 ] If the index allocated by idr_alloc greater than MINORMASK >> part_shift, the device number will overflow, resulting in failure to create a block device. Fix it by imiting the size of the max allocation. Signed-off-by:Zhong Jinghua <zhongjinghua@huawei.com> Reviewed-by:
Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20230605122159.2134384-1-zhongjinghua@huaweicloud.com Signed-off-by:
Jens Axboe <axboe@kernel.dk> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Loading
Please sign in to comment