First published: Tue Apr 02 2024(Updated: )
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".
Credit: 416baaa9-dc9f-4396-8d5f-8c081fb06d67 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Affected Software | Affected Version | How to fix |
---|---|---|
debian/linux | <=6.1.94-1<=6.1.99-1 | 5.10.218-1 5.10.221-1 6.9.10-1 6.9.12-1 |
ubuntu/linux | <6.5.0-41.41 | 6.5.0-41.41 |
ubuntu/linux | <6.8~ | 6.8~ |
ubuntu/linux-aws | <6.5.0-1021.21 | 6.5.0-1021.21 |
ubuntu/linux-aws | <6.8~ | 6.8~ |
ubuntu/linux-aws-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-aws-5.4 | <6.8~ | 6.8~ |
ubuntu/linux-aws-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-aws-fips | <6.8~ | 6.8~ |
ubuntu/linux-aws-hwe | <6.8~ | 6.8~ |
ubuntu/linux-azure | <6.5.0-1022.23 | 6.5.0-1022.23 |
ubuntu/linux-azure | <6.8~ | 6.8~ |
ubuntu/linux-azure-4.15 | <6.8~ | 6.8~ |
ubuntu/linux-azure-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-azure-5.4 | <6.8~ | 6.8~ |
ubuntu/linux-azure-6.5 | <6.5.0-1022.23~22.04.1 | 6.5.0-1022.23~22.04.1 |
ubuntu/linux-azure-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-azure-fde | <6.8~ | 6.8~ |
ubuntu/linux-azure-fde-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-azure-fips | <6.8~ | 6.8~ |
ubuntu/linux-bluefield | <6.8~ | 6.8~ |
ubuntu/linux-fips | <6.8~ | 6.8~ |
ubuntu/linux-gcp | <6.5.0-1022.24 | 6.5.0-1022.24 |
ubuntu/linux-gcp | <6.8~ | 6.8~ |
ubuntu/linux-gcp-4.15 | <6.8~ | 6.8~ |
ubuntu/linux-gcp-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-gcp-5.4 | <6.8~ | 6.8~ |
ubuntu/linux-gcp-6.5 | <6.5.0-1022.24~22.04.1 | 6.5.0-1022.24~22.04.1 |
ubuntu/linux-gcp-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-gcp-fips | <6.8~ | 6.8~ |
ubuntu/linux-gke | <6.8~ | 6.8~ |
ubuntu/linux-gkeop | <6.8~ | 6.8~ |
ubuntu/linux-gkeop-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-hwe | <6.8~ | 6.8~ |
ubuntu/linux-hwe-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-hwe-5.4 | <6.8~ | 6.8~ |
ubuntu/linux-hwe-6.5 | <6.5.0-41.41~22.04.2 | 6.5.0-41.41~22.04.2 |
ubuntu/linux-hwe-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-ibm | <6.8~ | 6.8~ |
ubuntu/linux-ibm-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-ibm-5.4 | <6.8~ | 6.8~ |
ubuntu/linux-intel | <6.8~ | 6.8~ |
ubuntu/linux-intel-iotg | <6.8~ | 6.8~ |
ubuntu/linux-intel-iotg-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-iot | <6.8~ | 6.8~ |
ubuntu/linux-kvm | <6.8~ | 6.8~ |
ubuntu/linux-laptop | <6.5.0-1017.20 | 6.5.0-1017.20 |
ubuntu/linux-laptop | <6.8~ | 6.8~ |
ubuntu/linux-lowlatency | <6.5.0-41.41.1 | 6.5.0-41.41.1 |
ubuntu/linux-lowlatency | <6.8~ | 6.8~ |
ubuntu/linux-lowlatency-hwe-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-lowlatency-hwe-6.5 | <6.5.0-41.41.1~22.04.1 | 6.5.0-41.41.1~22.04.1 |
ubuntu/linux-lowlatency-hwe-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-lts-xenial | <6.8~ | 6.8~ |
ubuntu/linux-nvidia | <6.8~ | 6.8~ |
ubuntu/linux-nvidia-6.5 | <6.5.0-1021.22 | 6.5.0-1021.22 |
ubuntu/linux-nvidia-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-nvidia-6.8 | <6.8~ | 6.8~ |
ubuntu/linux-nvidia-lowlatency | <6.8~ | 6.8~ |
ubuntu/linux-oem-6.5 | <6.5.0-1024.25 | 6.5.0-1024.25 |
ubuntu/linux-oem-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-oem-6.8 | <6.8~ | 6.8~ |
ubuntu/linux-oracle | <6.5.0-1024.24 | 6.5.0-1024.24 |
ubuntu/linux-oracle | <6.8~ | 6.8~ |
ubuntu/linux-oracle-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-oracle-5.4 | <6.8~ | 6.8~ |
ubuntu/linux-oracle-6.5 | <6.5.0-1024.24~22.04.1 | 6.5.0-1024.24~22.04.1 |
ubuntu/linux-oracle-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-raspi | <6.5.0-1018.21 | 6.5.0-1018.21 |
ubuntu/linux-raspi | <6.8~ | 6.8~ |
ubuntu/linux-raspi-5.4 | <6.8~ | 6.8~ |
ubuntu/linux-riscv | <6.5.0-40.40.1 | 6.5.0-40.40.1 |
ubuntu/linux-riscv | <6.8~ | 6.8~ |
ubuntu/linux-riscv-5.15 | <6.8~ | 6.8~ |
ubuntu/linux-riscv-6.5 | <6.5.0-40.40.1~22.04.1 | 6.5.0-40.40.1~22.04.1 |
ubuntu/linux-riscv-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-starfive | <6.5.0-1015.16 | 6.5.0-1015.16 |
ubuntu/linux-starfive | <6.8~ | 6.8~ |
ubuntu/linux-starfive-6.5 | <6.5.0-1015.16~22.04.1 | 6.5.0-1015.16~22.04.1 |
ubuntu/linux-starfive-6.5 | <6.8~ | 6.8~ |
ubuntu/linux-xilinx-zynqmp | <6.8~ | 6.8~ |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
(Appears in the following advisories)