Vulnerability · Published Apr 2, 2024 · Assigned by Linux

CVE-2024-26670arm64: entry: fix ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD

Medium 5.5

In plain English

A medium-severity out-of-bounds write 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 13% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.5Medium
Exploit odds (30 days)0.2%top 86.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: arm64: entry: fix ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD Currently the ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD workaround isn't quite right, as it is supposed to be applied after the last explicit memory access, but is immediately followed by an LDR. The ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD workaround is used to handle Cortex-A520 erratum 2966298 and Cortex-A510 erratum 3117295, which are described in: * https://developer.arm.com/documentation/SDEN2444153/0600/?lang=en * https://developer.arm.com/documentation/SDEN1873361/1600/?lang=en In both cases the workaround is described as: | If pagetable isolation is disabled, the context switch logic in the | kernel can be updated to execute the following sequence on affected | cores before exiting to EL0, and after all explicit memory accesses: | | 1. A non-shareable TLBI to any context and/or address, including | unused contexts or addresses, such as a `TLBI VALE1 Xzr`. | | 2. A DSB NSH to guarantee completion of the TLBI. The important part being that the TLBI+DSB must be placed "after all explicit memory accesses". Unfortunately, as-implemented, the TLBI+DSB is immediately followed by an LDR, as we have: | alternative_if ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD | tlbi vale1, xzr | dsb nsh | alternative_else_nop_endif | alternative_if_not ARM64_UNMAP_KERNEL_AT_EL0 | ldr lr, [sp, #S_LR] | add sp, sp, #PT_REGS_SIZE // restore sp | eret | alternative_else_nop_endif | | [ ... KPTI exception return path ... ] This patch fixes this by reworking the logic to place the TLBI+DSB immediately before the ERET, after all explicit memory accesses. The ERET is currently in a separate alternative block, and alternatives cannot be nested. To account for this, the alternative block for ARM64_UNMAP_KERNEL_AT_EL0 is replaced with a single alternative branch to skip the KPTI logic, with the new shape of the logic being: | alternative_insn "b .L_skip_tramp_exit_\@", nop, ARM64_UNMAP_KERNEL_AT_EL0 | [ ... KPTI exception return path ... ] | .L_skip_tramp_exit_\@: | | ldr lr, [sp, #S_LR] | add sp, sp, #PT_REGS_SIZE // restore sp | | alternative_if ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD | tlbi vale1, xzr | dsb nsh | alternative_else_nop_endif | eret The new structure means that the workaround is only applied when KPTI is not in use; this is fine as noted in the documented implications of the erratum: | Pagetable isolation between EL0 and higher level ELs prevents the | issue from occurring. ... and as per the workaround description quoted above, the workaround is only necessary "If pagetable isolation is disabled".

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linuxno fix listedDEBIAN-CVE-2024-26670
Debian:13linux6.6.15-1DEBIAN-CVE-2024-26670
Debian:14linux6.6.15-1DEBIAN-CVE-2024-26670
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-azure-6.56.5.0-1022.23~22.04.1UBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-gcp-6.56.5.0-1022.24~22.04.1UBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-hwe-6.56.5.0-41.41~22.04.2UBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.56.5.0-41.41.1~22.04.1UBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-nvidia-6.56.5.0-1021.22UBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-oem-6.56.5.0-1024.25UBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-oracle-6.56.5.0-1024.24~22.04.1UBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-riscv-6.56.5.0-40.40.1~22.04.1UBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-26670
Ubuntu:22.04:LTSlinux-starfive-6.56.5.0-1015.16~22.04.1UBUNTU-CVE-2024-26670

Affected products (as reported)

VendorProductVersions
Linux Linux 6e3ae2927b432a3b7c8374f14dbc1bd9ebe4372c – before d9a9a4d8ebc2fa534c0eb3eef3dae45f5e61b3e3471470bc7052d28ce125901877dd10e4c048e513 – before 58eb5c07f41704464b9acc09ab0707b6769db6c0471470bc7052d28ce125901877dd10e4c048e513 – before baa0aaac16432019651e0d60c41cd34a0c3c3477471470bc7052d28ce125901877dd10e4c048e513 – before 832dd634bd1b4e3bbe9f10b9c9ba5db6f6f2b97f32b0a4ffcaea44a00a61e40c0d1bcc50362aee256.1.57 – before 6.1.1916.5.7 – before 6.6
Linux Linux 6.6

Weakness: CWE-787 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

References