# CVE-2026-142916: powerpc: fix NMI exit ordering: restore soft masks after irqentry\_nmi\_exit()

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-12-03T03:25:57.218Z
- **Modified:** 2026-12-03T04:18:31.687Z

> **AI summary (AI-generated, claude-haiku-5-5):** 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.

## Who should check

- Anyone running Linux \>= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, \< 94bf70c51f3766222d83b86f911f04dd49897e61; \>= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, \< 8fa763bc3ee9bd215476ab91ee480c649eaa4b29
- Anyone running Linux 7.2

## 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

- Linux: \>= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, \< 94bf70c51f3766222d83b86f911f04dd49897e61; \>= bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc, \< 8fa763bc3ee9bd215476ab91ee480c649eaa4b29 (cvelist)
- Linux: 7.2 (cvelist)

## Technologies

Linux kernel

## Mitigation

- Upgrade Linux to 8fa763bc3ee9bd215476ab91ee480c649eaa4b29 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- other: <https://git.kernel.org/stable/c/94bf70c51f3766222d83b86f911f04dd49897e61>
- other: <https://git.kernel.org/stable/c/8fa763bc3ee9bd215476ab91ee480c649eaa4b29>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-142916>

HTML: <https://flawdb.com/CVE-2026-142916> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-142916>
