CVE-2023-52910

Source
https://cve.org/CVERecord?id=CVE-2023-52910
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-52910.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2023-52910
Downstream
Related
Published
2024-08-21T06:10:51.337Z
Modified
2026-03-12T03:27:47.512539Z
Summary
iommu/iova: Fix alloc iova overflows issue
Details

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 < lowpfn 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

  1. The node with the largest iova->pfnlo value in the iova domain is deleted, iovad->cachednode will be updated to iovad->anchor, and then the alloc iova size exceeds the maximum iova size that can be allocated in the domain.

After judging that retrypfn is less than limitpfn, call retry_pfn+1 to fix the overflow issue.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52910.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4e89dce725213d3d0b0475211b500eda4ef4bf2f
Fixed
c929a230c84441e400c32e7b7b4ab763711fb63e
Fixed
61cbf790e7329ed78877560be7136f0b911bba7f
Fixed
dcdb3ba7e2a8caae7bfefd603bc22fd0ce9a389c

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-52910.json"