{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38670","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-04-16T04:51:24.031Z","datePublished":"2025-08-22T16:03:01.242Z","dateUpdated":"2026-08-05T12:03:51.464Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:03:51.464Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\narm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack()\n\n`cpu_switch_to()` and `call_on_irq_stack()` manipulate SP to change\nto different stacks along with the Shadow Call Stack if it is enabled.\nThose two stack changes cannot be done atomically and both functions\ncan be interrupted by SErrors or Debug Exceptions which, though unlikely,\nis very much broken : if interrupted, we can end up with mismatched stacks\nand Shadow Call Stack leading to clobbered stacks.\n\nIn `cpu_switch_to()`, it can happen when SP_EL0 points to the new task,\nbut x18 stills points to the old task's SCS. When the interrupt handler\ntries to save the task's SCS pointer, it will save the old task\nSCS pointer (x18) into the new task struct (pointed to by SP_EL0),\nclobbering it.\n\nIn `call_on_irq_stack()`, it can happen when switching from the task stack\nto the IRQ stack and when switching back. In both cases, we can be\ninterrupted when the SCS pointer points to the IRQ SCS, but SP points to\nthe task stack. The nested interrupt handler pushes its return addresses\non the IRQ SCS. It then detects that SP points to the task stack,\ncalls `call_on_irq_stack()` and clobbers the task SCS pointer with\nthe IRQ SCS pointer, which it will also use !\n\nThis leads to tasks returning to addresses on the wrong SCS,\nor even on the IRQ SCS, triggering kernel panics via CONFIG_VMAP_STACK\nor FPAC if enabled.\n\nThis is possible on a default config, but unlikely.\nHowever, when enabling CONFIG_ARM64_PSEUDO_NMI, DAIF is unmasked and\ninstead the GIC is responsible for filtering what interrupts the CPU\nshould receive based on priority.\nGiven the goal of emulating NMIs, pseudo-NMIs can be received by the CPU\neven in `cpu_switch_to()` and `call_on_irq_stack()`, possibly *very*\nfrequently depending on the system configuration and workload, leading\nto unpredictable kernel panics.\n\nCompletely mask DAIF in `cpu_switch_to()` and restore it when returning.\nDo the same in `call_on_irq_stack()`, but restore and mask around\nthe branch.\nMask DAIF even if CONFIG_SHADOW_CALL_STACK is not enabled for consistency\nof behaviour between all configurations.\n\nIntroduce and use an assembly macro for saving and masking DAIF,\nas the existing one saves but only masks IF."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable window is in arm64 low-level entry code (`cpu_switch_to()`, `call_on_irq_stack()`) reached only by executing on the CPU — forcing context switches and taking interrupts/NMIs — which requires local code execution. No remote protocol data reaches this path; network traffic only produces normal-priority IRQs that are masked in the window.\nAC:L - An unprivileged task controls both sides: it can drive millions of context switches per second (pinned yield/futex ping-pong loops) to hit the ~20-instruction window continuously, while generating the interrupting side itself via high-frequency `perf_event_open()` sampling, whose PMU overflow IRQ is registered as a pseudo-NMI and is therefore delivered even with interrupts \"disabled\". The affected configurations (`CONFIG_SHADOW_CALL_STACK`, `CONFIG_ARM64_PSEUDO_NMI`) are default in Android GKI/ChromeOS and cloud arm64 kernels, not rare, and the commit itself notes the fault can occur \"*very* frequently\" under such configs.\nPR:L - Any unprivileged local user can trigger the code path — scheduling and interrupt handling need no capability at all — and unprivileged per-task perf sampling is permitted at the default `perf_event_paranoid=2`. No CAP_SYS_ADMIN, CAP_PERFMON, or root is required to reach or hammer the race.\nUI:N - The attacker's own threads generate both the context-switch storm and the NMI/exception source; no victim must open a file, mount anything, or run any application. Corruption of an unrelated task's shadow call stack happens as a side effect of normal scheduler operation.\nS:U - The clobbered shadow call stack pointer, corrupted `task_struct.scs_sp`, and resulting bad returns all occur within the kernel's own security authority on the same host. No VM, hypervisor, or IOMMU boundary is crossed.\nC:H - The race corrupts control-flow metadata across tasks — one task's `ret` sequence consumes another task's or the IRQ shadow stack — so execution resumes at a stale kernel return address while SP still refers to a mismatched frame, causing the kernel to interpret unrelated stack contents that can be copied back to userspace via the hijacked path. Defeating the SCS hardening and gaining control over which kernel code runs with foreign stack state is leverageable for kernel memory disclosure.\nI:H - This is genuine memory corruption: a pointer into a foreign shadow stack is written into another task's `task_struct`, return addresses are pushed into a shadow stack that belongs to a different context, and the victim task then returns to an address it never called. The commit states the wrong-SCS return only panics \"via CONFIG_VMAP_STACK or FPAC if enabled\", so on kernels without those hardenings the corrupted control flow proceeds — a control-flow hijack primitive whose targeted return addresses the attacker influences by choosing which syscalls populate the shadow stacks.\nA:H - The documented, observed outcome is \"unpredictable kernel panics\" — VMAP_STACK guard-page faults or FPAC aborts from returning onto the wrong shadow call stack — which is a full system crash. The condition was serious enough to warrant a stable backport across five stable trees after being reported as spontaneous panics on production arm64 systems."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/arm64/include/asm/assembler.h","arch/arm64/kernel/entry.S"],"versions":[{"version":"3f225f29c69c13ce1cbdb1d607a42efeef080056","lessThan":"f7e0231eeaa33245c649fac0303cf97209605446","status":"affected","versionType":"git"},{"version":"402d2b1d54b7085d0c3bfd01fd50c2701dde64b3","lessThan":"407047893a64399f2d2390ff35cc6061107d805d","status":"affected","versionType":"git"},{"version":"4403c7b7e5e1ad09a266b6e399fd7bf97931508e","lessThan":"a6b0cb523eaa01efe8a3f76ced493ba60674c6e6","status":"affected","versionType":"git"},{"version":"59b37fe52f49955791a460752c37145f1afdcad1","lessThan":"9433a5f437b0948d6a2d8a02ad7a42ab7ca27a61","status":"affected","versionType":"git"},{"version":"59b37fe52f49955791a460752c37145f1afdcad1","lessThan":"708fd522b86d2a9544c34ec6a86fa3fc23336525","status":"affected","versionType":"git"},{"version":"59b37fe52f49955791a460752c37145f1afdcad1","lessThan":"0f67015d72627bad72da3c2084352e0aa134416b","status":"affected","versionType":"git"},{"version":"59b37fe52f49955791a460752c37145f1afdcad1","lessThan":"d42e6c20de6192f8e4ab4cf10be8c694ef27e8cb","status":"affected","versionType":"git"},{"version":"e47ce4f11e26fa3ea99b09521da8b3ac3a7b578d","status":"affected","versionType":"git"},{"version":"5.10.180","lessThan":"5.10.210","status":"affected","versionType":"semver"},{"version":"5.15.111","lessThan":"5.15.190","status":"affected","versionType":"semver"},{"version":"6.1.28","lessThan":"6.1.149","status":"affected","versionType":"semver"},{"version":"6.2.15","lessThan":"6.3","status":"affected","versionType":"semver"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/arm64/include/asm/assembler.h","arch/arm64/kernel/entry.S"],"versions":[{"version":"6.3","status":"affected"},{"version":"0","lessThan":"6.3","status":"unaffected","versionType":"semver"},{"version":"5.10.210","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.190","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.149","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.101","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.41","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.15.9","lessThanOrEqual":"6.15.*","status":"unaffected","versionType":"semver"},{"version":"6.16","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10.180","versionEndExcluding":"5.10.210"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15.111","versionEndExcluding":"5.15.190"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1.28","versionEndExcluding":"6.1.149"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"6.6.101"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"6.12.41"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"6.15.9"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"6.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2.15"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/f7e0231eeaa33245c649fac0303cf97209605446"},{"url":"https://git.kernel.org/stable/c/407047893a64399f2d2390ff35cc6061107d805d"},{"url":"https://git.kernel.org/stable/c/a6b0cb523eaa01efe8a3f76ced493ba60674c6e6"},{"url":"https://git.kernel.org/stable/c/9433a5f437b0948d6a2d8a02ad7a42ab7ca27a61"},{"url":"https://git.kernel.org/stable/c/708fd522b86d2a9544c34ec6a86fa3fc23336525"},{"url":"https://git.kernel.org/stable/c/0f67015d72627bad72da3c2084352e0aa134416b"},{"url":"https://git.kernel.org/stable/c/d42e6c20de6192f8e4ab4cf10be8c694ef27e8cb"}],"title":"arm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack()","x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"}],"providerMetadata":{"orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE","dateUpdated":"2025-11-03T17:40:56.025Z"}},{"x_adpType":"supplier","providerMetadata":{"orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","shortName":"siemens-SADP","dateUpdated":"2026-05-12T12:05:16.720Z"},"affected":[{"vendor":"Siemens","product":"SIMATIC CN 4100","versions":[{"status":"affected","version":"0","lessThan":"V5.0","versionType":"custom"}],"defaultStatus":"unknown"}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html"}]}]}}