In the Linux kernel, the following vulnerability has been resolved: nbd: fix possible overflow on 'first_minor' in nbd_dev_add() When 'index' is a big numbers, it may become negative which forced to 'int'. then 'index << part_shift' might overflow to a positive value that is not greater than '0xfffff', then sysfs might complains about duplicate creation. Because of this, move the 'index' judgment to the front will fix it and be better.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2025022607-CVE-2022-49143-d2d8@gregkh/T