In the Linux kernel, the following vulnerability has been resolved:
iommu/iova: Fix alloc iova overflows issue
In _allocandinsertiovarange, there is an issue that retrypfn overflows. The value of iovad->anchor.pfnhi is ~0UL, then when iovad->cachednode is iovad->anchor, curriova->pfnhi + 1 will overflow. As a result, if the retry logic is executed, lowpfn is updated to 0, and then newpfn < low_pfn returns false to make the allocation successful.
This issue occurs in the following two situations: 1. The first iova size exceeds the domain size. When initializing iova domain, iovad->cachednode is assigned as iovad->anchor. For example, the iova domain size is 10M, startpfn is 0x1F0000000, and the iova size allocated for the first time is 11M. The following is the log information, new->pfnlo is smaller than iovad->cachednode.
Example log as follows: [ 223.798112][T1705487] sh: [name:iova&]allocandinsertiovarange startpfn:0x1f0000,retrypfn:0x0,size:0xb00,limitpfn:0x1f0a00 [ 223.799590][T1705487] sh: [name:iova&]allocandinsertiovarange success startpfn:0x1f0000,new->pfnlo:0x1efe00,new->pfnhi:0x1f08ff
After judging that retrypfn is less than limitpfn, call retry_pfn+1 to fix the overflow issue.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52910.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-52910.json"
[
{
"digest": {
"line_hashes": [
"331164490737932709382738841840521743503",
"322655481134782513609083394469988925505",
"145750324126279323683101160982625507634",
"124654522755374146576810599641428743720",
"164667092978119551462418122788380532543",
"15771048002945246829079537686861749785",
"220553932879020379632469381425892427338",
"122006965820738957210256782391771237025"
],
"threshold": 0.9
},
"id": "CVE-2023-52910-02eec103",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@61cbf790e7329ed78877560be7136f0b911bba7f",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/iommu/iova.c"
},
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"331164490737932709382738841840521743503",
"322655481134782513609083394469988925505",
"145750324126279323683101160982625507634",
"124654522755374146576810599641428743720",
"164667092978119551462418122788380532543",
"15771048002945246829079537686861749785",
"220553932879020379632469381425892427338",
"122006965820738957210256782391771237025"
],
"threshold": 0.9
},
"id": "CVE-2023-52910-67e10570",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@dcdb3ba7e2a8caae7bfefd603bc22fd0ce9a389c",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/iommu/iova.c"
},
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"331164490737932709382738841840521743503",
"322655481134782513609083394469988925505",
"145750324126279323683101160982625507634",
"124654522755374146576810599641428743720",
"164667092978119551462418122788380532543",
"15771048002945246829079537686861749785",
"220553932879020379632469381425892427338",
"122006965820738957210256782391771237025"
],
"threshold": 0.9
},
"id": "CVE-2023-52910-731263b0",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c929a230c84441e400c32e7b7b4ab763711fb63e",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/iommu/iova.c"
},
"signature_type": "Line"
}
]