8.8high
iommu/iova: Fix alloc iova overflows issue
- Severity
- 8.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.24% (higher than 16% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: iommu/iova: Fix alloc iova overflows issue In __alloc_and_insert_iova_range, there is an issue that retry_pfn overflows. The value of iovad->anchor.pfn_hi is ~0UL, then when iovad->cached_node is iovad->anchor, curr_iova->pfn_hi + 1 will overflow. As a result, if the retry logic is executed, low_pfn is updated to 0, and then new_pfn < 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->cached_node is assigned as iovad->anchor. For example, the iova domain size is 10M, start_pfn is 0x1_F000_0000, and the iova size allocated for the first time is 11M. The following is the log information, new->pfn_lo is smaller than iovad->cached_node. Example log as follows: [ 223.798112][T1705487] sh: [name:iova&]__alloc_and_insert_iova_range start_pfn:0x1f0000,retry_pfn:0x0,size:0xb00,limit_pfn:0x1f0a00 [ 223.799590][T1705487] sh: [name:iova&]__alloc_and_insert_iova_range success start_pfn:0x1f0000,new->pfn_lo:0x1efe00,new->pfn_hi:0x1f08ff 2. The node with the largest iova->pfn_lo value in the iova domain is deleted, iovad->cached_node 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 retry_pfn is less than limit_pfn, call retry_pfn+1 to fix the overflow issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 4e89dce725213d3d0b0475211b500eda4ef4bf2f before c929a230c84441e400c32e7b7b4ab763711fb63e, from 4e89dce725213d3d0b0475211b500eda4ef4bf2f before 61cbf790e7329ed78877560be7136f0b911bba7f, from 4e89dce725213d3d0b0475211b500eda4ef4bf2f before dcdb3ba7e2a8caae7bfefd603bc22fd0ce9a389c, 5.11 Not affected: before 5.11, from 5.15.89 up to 5.15.*, from 6.1.7 up to 6.1.*, from 6.2 up to * | CVE List |
| linux linux_kernel | from 5.11 before 5.15.89, from 5.16 before 6.1.7, 6.2 | NVD |
All scores
| Linux | 8.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: iommu/iova: Fix alloc iova overflows issue In __alloc_and_insert_iova_range, there is an issue that retry_pfn overflows. The value of iovad->anchor.pfn_hi is ~0UL, then when iovad->cached_node is iovad->anchor, curr_iova->pfn_hi + 1 will overflow. As a result, if the retry logic is executed, low_pfn is updated to 0, and then new_pfn < 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->cached_node is assigned as iovad->anchor. For example, the iova domain size is 10M, start_pfn is 0x1_F000_0000, and the iova size allocated for the first time is 11M. The following is the log information, new->pfn_lo is smaller than iovad->cached_node. Example log as follows: [ 223.798112][T1705487] sh: [name:iova&]__alloc_and_insert_iova_range start_pfn:0x1f0000,retry_pfn:0x0,size:0xb00,limit_pfn:0x1f0a00 [ 223.799590][T1705487] sh: [name:iova&]__alloc_and_insert_iova_range success start_pfn:0x1f0000,new->pfn_lo:0x1efe00,new->pfn_hi:0x1f08ff 2. The node with the largest iova->pfn_lo value in the iova domain is deleted, iovad->cached_node 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 retry_pfn is less than limit_pfn, call retry_pfn+1 to fix the overflow issue.
NVD (es)
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: iommu/iova: soluciona el problema de desbordamiento de alloc iova. En __alloc_and_insert_iova_range, hay un problema que retry_pfn se desborda. El valor de iovad->anchor.pfn_hi es ~0UL, luego, cuando iovad->cached_node es iovad->anchor, curr_iova->pfn_hi + 1 se desbordará. Como resultado, si se ejecuta la lógica de reintento, low_pfn se actualiza a 0 y luego new_pfn < low_pfn devuelve falso para que la asignación sea exitosa. Este problema ocurre en las dos situaciones siguientes: 1. El tamaño del primer iova excede el tamaño del dominio. Al inicializar el dominio iova, iovad->cached_node se asigna como iovad->anchor. Por ejemplo, el tamaño del dominio iova es 10 M, start_pfn es 0x1_F000_0000 y el tamaño de iova asignado por primera vez es 11 M. La siguiente es la información de registro, new->pfn_lo es más pequeño que iovad->cached_node. Registro de ejemplo como sigue: [ 223.798112][T1705487] sh: [name:iova&]__alloc_and_insert_iova_range start_pfn:0x1f0000,retry_pfn:0x0,size:0xb00,limit_pfn:0x1f0a00 [ 223.799590][T1705487] [nombre:iova&]__alloc_and_insert_iova_range éxito start_pfn :0x1f0000,new->pfn_lo:0x1efe00,new->pfn_hi:0x1f08ff 2. El nodo con el valor iova->pfn_lo más grande en el dominio iova se elimina, iovad->cached_node se actualizará a iovad->anchor y luego el tamaño de alloc iova excede el tamaño máximo de iova que se puede asignar en el dominio. Después de juzgar que retry_pfn es menor que limit_pfn, llame a retry_pfn+1 para solucionar el problema de desbordamiento.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-52910 changed 2026-08-05 | CVE Terms of Use |
| NVD | CVE-2023-52910 changed 2026-08-04 | Public domain |