Vulnerability · Published Aug 22, 2025 · Assigned by Linux

CVE-2025-38670arm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack()

High 7.8

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 6% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.2%top 93.9% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: arm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack() `cpu_switch_to()` and `call_on_irq_stack()` manipulate SP to change to different stacks along with the Shadow Call Stack if it is enabled. Those two stack changes cannot be done atomically and both functions can be interrupted by SErrors or Debug Exceptions which, though unlikely, is very much broken : if interrupted, we can end up with mismatched stacks and Shadow Call Stack leading to clobbered stacks. In `cpu_switch_to()`, it can happen when SP_EL0 points to the new task, but x18 stills points to the old task's SCS. When the interrupt handler tries to save the task's SCS pointer, it will save the old task SCS pointer (x18) into the new task struct (pointed to by SP_EL0), clobbering it. In `call_on_irq_stack()`, it can happen when switching from the task stack to the IRQ stack and when switching back. In both cases, we can be interrupted when the SCS pointer points to the IRQ SCS, but SP points to the task stack. The nested interrupt handler pushes its return addresses on the IRQ SCS. It then detects that SP points to the task stack, calls `call_on_irq_stack()` and clobbers the task SCS pointer with the IRQ SCS pointer, which it will also use ! This leads to tasks returning to addresses on the wrong SCS, or even on the IRQ SCS, triggering kernel panics via CONFIG_VMAP_STACK or FPAC if enabled. This is possible on a default config, but unlikely. However, when enabling CONFIG_ARM64_PSEUDO_NMI, DAIF is unmasked and instead the GIC is responsible for filtering what interrupts the CPU should receive based on priority. Given the goal of emulating NMIs, pseudo-NMIs can be received by the CPU even in `cpu_switch_to()` and `call_on_irq_stack()`, possibly *very* frequently depending on the system configuration and workload, leading to unpredictable kernel panics. Completely mask DAIF in `cpu_switch_to()` and restore it when returning. Do the same in `call_on_irq_stack()`, but restore and mask around the branch. Mask DAIF even if CONFIG_SHADOW_CALL_STACK is not enabled for consistency of behaviour between all configurations. Introduce and use an assembly macro for saving and masking DAIF, as the existing one saves but only masks IF.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.153-1DEBIAN-CVE-2025-38670
Debian:12linux6.1.153-1DSA-6009-1
Debian:13linux6.12.41-1DEBIAN-CVE-2025-38670
Debian:14linux6.16.3-1DEBIAN-CVE-2025-38670
Ubuntu:22.04:LTSlinux5.15.0-163.173UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux6.8.0-100.100UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-aws5.15.0-1097.104UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-aws6.8.0-1046.49UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-aws-6.146.14.0-1017.17~24.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1046.49~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure5.15.0-1101.110UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-azure6.8.0-1046.52UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-azure-6.11no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-azure-6.146.14.0-1017.17~24.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1051.57~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1102.111.1UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-azure-fde6.8.0-1046.53UBUNTU-CVE-2025-38670
Ubuntu:25.10linux-azure-fdeno fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-azure-fde-6.14no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-azure-fde-6.86.8.0-1046.53~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-azure-nvidiano fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-azure-nvidia-6.14no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-gcp5.15.0-1097.106UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-gcp6.8.0-1047.50UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-gcp-6.11no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-gcp-6.146.14.0-1020.21~24.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1047.50~22.04.2UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-gke5.15.0-1093.99UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-gke6.8.0-1043.48UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1080.88UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1030.33UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-hwe-6.11no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-100.100~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-ibm5.15.0-1091.94UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-ibm6.8.0-1044.44UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1044.44~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-intelno fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1092.98UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-kvm5.15.0-1089.94UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-163.173UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-100.100.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-lowlatency-hwe-6.11no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-100.100.1~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1092.93UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1046.49UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-nvidia-6.11no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1046.49~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1046.49.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1049.49UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-nvidia-tegra6.8.0-1020.20UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1038.38UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-oem-6.11no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-oem-6.146.14.0-1016.16UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-oem-6.8no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-oracle5.15.0-1094.100UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-oracle6.8.0-1043.44UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-oracle-6.146.14.0-1017.17~24.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1043.44~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-raspi5.15.0-1091.94UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-raspi6.8.0-1047.51UBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-riscv-6.146.14.0-36.36.1~24.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-100.100~22.04.1UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2025-38670
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1023.24UBUNTU-CVE-2025-38670
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1061.65UBUNTU-CVE-2025-38670

Affected products (as reported)

VendorProductVersions
Linux Linux 3f225f29c69c13ce1cbdb1d607a42efeef080056 – before f7e0231eeaa33245c649fac0303cf97209605446402d2b1d54b7085d0c3bfd01fd50c2701dde64b3 – before 407047893a64399f2d2390ff35cc6061107d805d4403c7b7e5e1ad09a266b6e399fd7bf97931508e – before a6b0cb523eaa01efe8a3f76ced493ba60674c6e659b37fe52f49955791a460752c37145f1afdcad1 – before 9433a5f437b0948d6a2d8a02ad7a42ab7ca27a6159b37fe52f49955791a460752c37145f1afdcad1 – before 708fd522b86d2a9544c34ec6a86fa3fc2333652559b37fe52f49955791a460752c37145f1afdcad1 – before 0f67015d72627bad72da3c2084352e0aa134416b59b37fe52f49955791a460752c37145f1afdcad1 – before d42e6c20de6192f8e4ab4cf10be8c694ef27e8cbe47ce4f11e26fa3ea99b09521da8b3ac3a7b578d
Linux Linux 6.3

References