PT-2026-166653
CVE-2026-142916
·
Publicado
2026-12-03
·
Atualizado
2026-12-03
Descrição por
Pontuação
N/A
Não disponívelNão há classificações de severidade ou métricas disponíveis. Quando houver, atualizaremos as informações correspondentes na página.
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
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.
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾