Vulnerability · Published May 20, 2024 · Assigned by Linux
CVE-2024-35980arm64: tlb: Fix TLBI RANGE operand
High 8.4
In plain English
A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 14% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: arm64: tlb: Fix TLBI RANGE operand KVM/arm64 relies on TLBI RANGE feature to flush TLBs when the dirty pages are collected by VMM and the page table entries become write protected during live migration. Unfortunately, the operand passed to the TLBI RANGE instruction isn't correctly sorted out due to the commit 117940aa6e5f ("KVM: arm64: Define kvm_tlb_flush_vmid_range()"). It leads to crash on the destination VM after live migration because TLBs aren't flushed completely and some of the dirty pages are missed. For example, I have a VM where 8GB memory is assigned, starting from 0x40000000 (1GB). Note that the host has 4KB as the base page size. In the middile of migration, kvm_tlb_flush_vmid_range() is executed to flush TLBs. It passes MAX_TLBI_RANGE_PAGES as the argument to __kvm_tlb_flush_vmid_range() and __flush_s2_tlb_range_op(). SCALE#3 and NUM#31, corresponding to MAX_TLBI_RANGE_PAGES, isn't supported by __TLBI_RANGE_NUM(). In this specific case, -1 has been returned from __TLBI_RANGE_NUM() for SCALE#3/2/1/0 and rejected by the loop in the __flush_tlb_range_op() until the variable @scale underflows and becomes -9, 0xffff708000040000 is set as the operand. The operand is wrong since it's sorted out by __TLBI_VADDR_RANGE() according to invalid @scale and @num. Fix it by extending __TLBI_RANGE_NUM() to support the combination of SCALE#3 and NUM#31. With the changes, [-1 31] instead of [-1 30] can be returned from the macro, meaning the TLBs for 0x200000 pages in the above example can be flushed in one shoot with SCALE#3 and NUM#31. The macro TLBI_RANGE_MASK is dropped since no one uses it any more. The comments are also adjusted accordingly.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:13 | linux | 6.8.9-1 | DEBIAN-CVE-2024-35980 |
| Debian:14 | linux | 6.8.9-1 | DEBIAN-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux | 6.8.0-38.38 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1011.12 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1011.12~22.04.1 | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1010.10 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1010.10~22.04.1 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1010.11 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1006.9 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1008.8 | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-intel | 6.8.0-1007.14 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-38.38.1 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1009.9 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1009.9~22.04.1 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1008.8 | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1008.8 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1008.8~22.04.1 | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1007.7 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-38.38.1 | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-35980 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-35980 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 117940aa6e5f8308f1529e1313660980f1dae771 – before ac4ad513de4fba18b4ac0ace132777d0910e8cfa117940aa6e5f8308f1529e1313660980f1dae771 – before 944db7b536baaf49d7e576af36a94f4719552b07117940aa6e5f8308f1529e1313660980f1dae771 – before e3ba51ab24fddef79fc212f9840de54db8fd1685 |
| Linux | Linux | 6.6 |