CVE-2022-49140: Revert "nbd: fix possible overflow on 'first_minor' in nbd_dev_add()"
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
Revert "nbd: fix possible overflow on 'first_minor' in nbd_dev_add()"
This reverts commit 6d35d04a9e18990040e87d2bbf72689252669d54.
Both Gabriel and Borislav report that this commit casues a regression with nbd:
sysfs: cannot create duplicate filename '/dev/block/43:0'
Revert it before 5.18-rc1 and we'll investigage this separately in due time.
The Linux kernel CVE team has assigned CVE-2022-49140 to this issue.
Affected and fixed versions
===========================
Fixed in 5.15.34 with commit 3b14aa053181709d42319d4145855025c23ddd12 Fixed in 5.16.19 with commit 24781c1b691c60c42748c669973d567a90573337 Fixed in 5.17.2 with commit 9d73b40f979737029bac724c39648016da3f914c Fixed in 5.18 with commit 7198bfc2017644c6b92d2ecef9b8b8e0363bb5fd
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2022-49140
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/block/nbd.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/3b14aa053181709d42319d4145855025c23ddd12 https://git.kernel.org/stable/c/24781c1b691c60c42748c669973d567a90573337 https://git.kernel.org/stable/c/9d73b40f979737029bac724c39648016da3f914c https://git.kernel.org/stable/c/7198bfc2017644c6b92d2ecef9b8b8e0363bb5fd