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.
[
{
"id": "CVE-2022-49147-1af1ea8e",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fbe2cc4525480ddd20c866bb5c0578071e01451a",
"signature_type": "Function",
"digest": {
"function_hash": "39655821605213288365953338364684798421",
"length": 160.0
},
"deprecated": false,
"target": {
"file": "block/genhd.c",
"function": "blk_alloc_ext_minor"
}
},
{
"id": "CVE-2022-49147-26bbaa4e",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5b9ac3727e4abb11c9cfbe9c0781fc05dfdd7cfb",
"signature_type": "Function",
"digest": {
"function_hash": "39655821605213288365953338364684798421",
"length": 160.0
},
"deprecated": false,
"target": {
"file": "block/genhd.c",
"function": "blk_alloc_ext_minor"
}
},
{
"id": "CVE-2022-49147-3f9fb492",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fbe2cc4525480ddd20c866bb5c0578071e01451a",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"300935707121630565561571391826764172298",
"327276867219587432560543842152011469848",
"232541085162029296722930021399493095198",
"85653456643228550809886322547131362204"
]
},
"deprecated": false,
"target": {
"file": "block/genhd.c"
}
},
{
"id": "CVE-2022-49147-7123ee0e",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5b9ac3727e4abb11c9cfbe9c0781fc05dfdd7cfb",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"300935707121630565561571391826764172298",
"327276867219587432560543842152011469848",
"232541085162029296722930021399493095198",
"85653456643228550809886322547131362204"
]
},
"deprecated": false,
"target": {
"file": "block/genhd.c"
}
},
{
"id": "CVE-2022-49147-a78ca32e",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d1868328dec5ae2cf210111025fcbc71f78dd5ca",
"signature_type": "Function",
"digest": {
"function_hash": "39655821605213288365953338364684798421",
"length": 160.0
},
"deprecated": false,
"target": {
"file": "block/genhd.c",
"function": "blk_alloc_ext_minor"
}
},
{
"id": "CVE-2022-49147-cc2c1007",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f8cf8f5ccbad25ed6828875b222dbab29d5c272",
"signature_type": "Function",
"digest": {
"function_hash": "39655821605213288365953338364684798421",
"length": 160.0
},
"deprecated": false,
"target": {
"file": "block/genhd.c",
"function": "blk_alloc_ext_minor"
}
},
{
"id": "CVE-2022-49147-ce5e9797",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d1868328dec5ae2cf210111025fcbc71f78dd5ca",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"300935707121630565561571391826764172298",
"327276867219587432560543842152011469848",
"232541085162029296722930021399493095198",
"85653456643228550809886322547131362204"
]
},
"deprecated": false,
"target": {
"file": "block/genhd.c"
}
},
{
"id": "CVE-2022-49147-f81974e1",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f8cf8f5ccbad25ed6828875b222dbab29d5c272",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"300935707121630565561571391826764172298",
"327276867219587432560543842152011469848",
"232541085162029296722930021399493095198",
"85653456643228550809886322547131362204"
]
},
"deprecated": false,
"target": {
"file": "block/genhd.c"
}
}
]