在 2023/10/25 18:06, Tetsuo Handa 写道:
On 2023/10/25 17:46, Zhong Jinghua wrote:
Checks added in patch:
commit e338924bd05d ("block: check minor range in device_add_disk()")
ignore the problem of first_minore < 0 and disk->minors < 0.
What is the problem of first_minor < 0 or disk->minors < 0 ?
Are negative values legal/illegal ?
These two values are used as the secondary device number and the maximum number of partitions, which is illegal if negative. Then first_minore and disk->minors are signed numbers, and the sum may be less than MINORMASK to bypass the check.