CVE-2026-142916
powerpc: fix NMI exit ordering: restore soft masks after irqentry_nmi_exit()
AI summary AI generated
A flaw in the Linux kernel PowerPC NMI exit path lets a bad rfid or trap cause a kernel Oops when debug and lockdep options are enabled, due to misordered soft-mask restoration.
Mitigation
- Upgrade Linux to 8fa763bc3ee9bd215476ab91ee480c649eaa4b29 or later.
Who should check
- Anyone running Linux >= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, < 94bf70c51f3766222d83b86f911f04dd49897e61; >= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, < 8fa763bc3ee9bd215476ab91ee480c649eaa4b29
- Anyone running Linux 7.2
Vulnerability facts
- Affected
- Linux >= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, < 94bf70c51f3766222d83b86f911f04dd49897e61; >= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, < 8fa763bc3ee9bd215476ab91ee480c649eaa4b29; Linux 7.2
- Fixed in
- Linux 94bf70c51f3766222d83b86f911f04dd49897e61, Linux 8fa763bc3ee9bd215476ab91ee480c649eaa4b29
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Unknown
- CVSS
- Not scored yet
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: powerpc: fix NMI exit ordering: restore soft masks after irqentry_nmi_exit() When running with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y and LOCKDEP=y, an Oops is triggered during NMI exit: [ 202.258332] Oops: Exception in kernel mode, sig: 4 [#1] NIP [000000000003e178] 0x3e178 LR [c00000000003e174] arch_local_irq_restore+0x2a4/0x328 TRAP: 0700 MSR: 0000000000081000 <ME> The faulting instruction at NIP is a 'trap' (0fe00000) inside the rfi_flush_fallback trampoline at a userspace-looking low address, reached after a bad rfid caused by an incorrect SRR0 value. Root cause: DEFINE_INTERRUPT_HANDLER_NMI used to call arch_interrupt_nmi_exit_prepare() *before* irqentry_nmi_exit(), giving this sequence: arch_interrupt_nmi_enter_prepare() // saves irq_soft_mask, irq_happened irqentry_nmi_enter() // __nmi_enter() -> nmi_count++, in_nmi()=true ____func(regs) // NMI handler body arch_interrupt_nmi_exit_prepare() // RESTORES irq_soft_mask=0 (IRQS_ENABLED) // RESTORES irq_happened with pending bits irqentry_nmi_exit() // instrumentation block runs here... trace_hardirqs_on_prepare() // ...with in_nmi()==true still lockdep_hardirqs_on_prepare() // ...and irq_soft_mask already restored to 0 -> arch_local_irq_restore(0) // mask=0 -> enable path entered WARN_ON_ONCE(in_nmi()) // FIRES: __nmi_exit() hasn't run yet __nmi_exit() // nmi_count-- (too late) arch_interrupt_nmi_exit_prepare() restores irq_soft_mask to whatever the interrupted thread had (IRQS_ENABLED / 0) and restores irq_happened with any pending deferred-interrupt bits that were present when the NMI fired. This is correct and necessary before rfid back to the interrupted context, but it must not happen until irqentry_nmi_exit() has fully completed. With irq_soft_mask=0 and pending bits in irq_happened, the trace_hardirqs_on_prepare() call inside irqentry_nmi_exit()'s instrumentation block reaches lockdep_hardirqs_on_prepare() which calls __trace_hardirqs_on_caller(), which eventually calls arch_local_irq_restore(0) (the IRQS_ENABLED / enable path). arch_local_irq_restore() with mask=0 hits the CONFIG_PPC_IRQ_SOFT_MASK_DEBUG guards at irq_64.c:217: WARN_ON_ONCE(in_nmi()); // TRUE: __nmi_exit() not yet called The WARN_ON_ONCE fires a 'trap' instruction (tw 31,0,0 / 0fe00000) in kernel mode with MSR_PR=0, MSR_IR=0 (real-mode). The program check handler (TRAP 0700) takes the sig:4 (SIGILL) path via do_program_check() and calls die(), producing the Oops. The RESTART_TABLE mechanism in arch_local_irq_restore then causes the bad rfid that lands at the userspace-looking address visible in the NIP. The bug is invisible with LOCKDEP=n because trace_hardirqs_on_prepare() is a no-op when CONFIG_TRACE_IRQFLAGS is not set (TRACE_IRQFLAGS is selected by PROVE_LOCKING which selects LOCKDEP). Fix: Move arch_interrupt_nmi_exit_prepare() to after the irqentry_nmi_exit() block, so that: irqentry_nmi_exit() // __nmi_exit() -> nmi_count--, in_nmi()=false arch_interrupt_nmi_exit_prepare() // now safe to restore soft mask state The instrumentation inside irqentry_nmi_exit() now executes while in_nmi() is still true (nmi_count not yet decremented), but irq_soft_mask is still IRQS_ALL_DISABLED (NMI-entry value), so arch_local_irq_restore() is never called with mask=0 from that path. After __nmi_exit() returns, arch_interrupt_nmi_exit_prepare() restores the pre-NMI soft mask and irq_happened, which is the correct state for the rfid back to the interrupted context.
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-142916. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-142916.md Affected: Linux >= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, < 94bf70c51f3766222d83b86f911f04dd49897e61; >= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, < 8fa763bc3ee9bd215476ab91ee480c649eaa4b29; Linux 7.2 Fixed in: Linux 94bf70c51f3766222d83b86f911f04dd49897e61, Linux 8fa763bc3ee9bd215476ab91ee480c649eaa4b29 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
Technologies
References
FAQ
Is CVE-2026-142916 being exploited?
There is no confirmed exploitation: CVE-2026-142916 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.
How serious is CVE-2026-142916?
It has no CVSS score yet. Unknown.
Which versions are affected by CVE-2026-142916?
Linux >= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, < 94bf70c51f3766222d83b86f911f04dd49897e61; >= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, < 8fa763bc3ee9bd215476ab91ee480c649eaa4b29; Linux 7.2.
Is there a fix for CVE-2026-142916?
Yes. Fixed in Linux 94bf70c51f3766222d83b86f911f04dd49897e61, Linux 8fa763bc3ee9bd215476ab91ee480c649eaa4b29. Upgrade Linux to 8fa763bc3ee9bd215476ab91ee480c649eaa4b29 or later.
How do I check if I'm affected by CVE-2026-142916?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.
More Linux kernel vulnerabilities
See all| Severity | Identifier / vulnerability | Technology | Signals | Age |
|---|---|---|---|---|
| UNSCORED | CVE-2026-142948 i2c: designware: queue only one read command for block reads | Linux kernel | ||
| UNSCORED | CVE-2026-142947 cxl/core: Skip einj_inject creation when devm_add_action_or_reset() fails | Linux kernel | ||
| UNSCORED | CVE-2026-142946 ASoC: amd: acp-es8336: Switch to use acpi_bus_get_primary_device() | Linux kernel | ||
| UNSCORED | CVE-2026-142945 ASoC: amd: acp3x-es83xx: Switch to use acpi_bus_get_primary_device() | Linux kernel | ||
| UNSCORED | CVE-2026-142944 ASoC: amd: acp-es8336: Use an owned codec device reference | Linux kernel |