In the Linux kernel, the following vulnerability has been resolved:
block: Fix the maximum minor value is blkallocext_minor()
idaallocrange(..., min, max, ...) returns values from min to max, inclusive.
So, NREXTDEVT is a valid idx returned by blkallocext_minor().
This is an issue because in deviceadddisk(), this value is used in: ddev->devt = MKDEV(disk->major, disk->firstminor); and NREXT_DEVT is '(1 << MINORBITS)'.
So, should 'disk->firstminor' be NREXT_DEVT, it would overflow.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49147.json"
}"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49147.json"
[
{
"signature_type": "Function",
"id": "CVE-2022-49147-26bbaa4e",
"deprecated": false,
"target": {
"function": "blk_alloc_ext_minor",
"file": "block/genhd.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5b9ac3727e4abb11c9cfbe9c0781fc05dfdd7cfb",
"digest": {
"length": 160.0,
"function_hash": "39655821605213288365953338364684798421"
},
"signature_version": "v1"
},
{
"signature_type": "Line",
"id": "CVE-2022-49147-7123ee0e",
"deprecated": false,
"target": {
"file": "block/genhd.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5b9ac3727e4abb11c9cfbe9c0781fc05dfdd7cfb",
"digest": {
"line_hashes": [
"300935707121630565561571391826764172298",
"327276867219587432560543842152011469848",
"232541085162029296722930021399493095198",
"85653456643228550809886322547131362204"
],
"threshold": 0.9
},
"signature_version": "v1"
},
{
"signature_type": "Function",
"id": "CVE-2022-49147-a78ca32e",
"deprecated": false,
"target": {
"function": "blk_alloc_ext_minor",
"file": "block/genhd.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d1868328dec5ae2cf210111025fcbc71f78dd5ca",
"digest": {
"length": 160.0,
"function_hash": "39655821605213288365953338364684798421"
},
"signature_version": "v1"
},
{
"signature_type": "Function",
"id": "CVE-2022-49147-cc2c1007",
"deprecated": false,
"target": {
"function": "blk_alloc_ext_minor",
"file": "block/genhd.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f8cf8f5ccbad25ed6828875b222dbab29d5c272",
"digest": {
"length": 160.0,
"function_hash": "39655821605213288365953338364684798421"
},
"signature_version": "v1"
},
{
"signature_type": "Line",
"id": "CVE-2022-49147-ce5e9797",
"deprecated": false,
"target": {
"file": "block/genhd.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d1868328dec5ae2cf210111025fcbc71f78dd5ca",
"digest": {
"line_hashes": [
"300935707121630565561571391826764172298",
"327276867219587432560543842152011469848",
"232541085162029296722930021399493095198",
"85653456643228550809886322547131362204"
],
"threshold": 0.9
},
"signature_version": "v1"
},
{
"signature_type": "Line",
"id": "CVE-2022-49147-f81974e1",
"deprecated": false,
"target": {
"file": "block/genhd.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f8cf8f5ccbad25ed6828875b222dbab29d5c272",
"digest": {
"line_hashes": [
"300935707121630565561571391826764172298",
"327276867219587432560543842152011469848",
"232541085162029296722930021399493095198",
"85653456643228550809886322547131362204"
],
"threshold": 0.9
},
"signature_version": "v1"
}
]