{"api_version":"1","generated_at":"2026-12-04T10:57:18+00:00","cve":"CVE-2026-142916","urls":{"html":"https://cve.report/CVE-2026-142916","api":"https://cve.report/api/cve/CVE-2026-142916.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-142916","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-142916"},"summary":{"title":"powerpc: fix NMI exit ordering: restore soft masks after irqentry_nmi_exit()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc: fix NMI exit ordering: restore soft masks after irqentry_nmi_exit()\n\nWhen running with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y and LOCKDEP=y, an\nOops is triggered during NMI exit:\n\n  [  202.258332] Oops: Exception in kernel mode, sig: 4 [#1]\n  NIP [000000000003e178] 0x3e178\n  LR  [c00000000003e174] arch_local_irq_restore+0x2a4/0x328\n  TRAP: 0700  MSR: 0000000000081000 <ME>\n\nThe faulting instruction at NIP is a 'trap' (0fe00000) inside the\nrfi_flush_fallback trampoline at a userspace-looking low address, reached\nafter a bad rfid caused by an incorrect SRR0 value.\n\nRoot cause:\nDEFINE_INTERRUPT_HANDLER_NMI used to call arch_interrupt_nmi_exit_prepare()\n*before* irqentry_nmi_exit(), giving this sequence:\n\n  arch_interrupt_nmi_enter_prepare()   // saves irq_soft_mask, irq_happened\n  irqentry_nmi_enter()                 // __nmi_enter() -> nmi_count++, in_nmi()=true\n  ____func(regs)                       // NMI handler body\n  arch_interrupt_nmi_exit_prepare()    // RESTORES irq_soft_mask=0 (IRQS_ENABLED)\n                                       // RESTORES irq_happened with pending bits\n  irqentry_nmi_exit()                  // instrumentation block runs here...\n    trace_hardirqs_on_prepare()        //   ...with in_nmi()==true still\n    lockdep_hardirqs_on_prepare()      //   ...and irq_soft_mask already restored to 0\n      -> arch_local_irq_restore(0)     // mask=0 -> enable path entered\n           WARN_ON_ONCE(in_nmi())      // FIRES: __nmi_exit() hasn't run yet\n    __nmi_exit()                       // nmi_count-- (too late)\n\narch_interrupt_nmi_exit_prepare() restores irq_soft_mask to whatever\nthe interrupted thread had (IRQS_ENABLED / 0) and restores irq_happened\nwith any pending deferred-interrupt bits that were present when the NMI\nfired.  This is correct and necessary before rfid back to the interrupted\ncontext, but it must not happen until irqentry_nmi_exit() has fully\ncompleted.\n\nWith irq_soft_mask=0 and pending bits in irq_happened, the\ntrace_hardirqs_on_prepare() call inside irqentry_nmi_exit()'s\ninstrumentation block reaches lockdep_hardirqs_on_prepare() which\ncalls __trace_hardirqs_on_caller(), which eventually calls\narch_local_irq_restore(0) (the IRQS_ENABLED / enable path).\n\narch_local_irq_restore() with mask=0 hits the CONFIG_PPC_IRQ_SOFT_MASK_DEBUG\nguards at irq_64.c:217:\n\n  WARN_ON_ONCE(in_nmi());   // TRUE: __nmi_exit() not yet called\n\nThe WARN_ON_ONCE fires a 'trap' instruction (tw 31,0,0 / 0fe00000) in\nkernel mode with MSR_PR=0, MSR_IR=0 (real-mode).  The program check\nhandler (TRAP 0700) takes the sig:4 (SIGILL) path via do_program_check()\nand calls die(), producing the Oops.\n\nThe RESTART_TABLE mechanism in arch_local_irq_restore then causes the\nbad rfid that lands at the userspace-looking address visible in the NIP.\n\nThe bug is invisible with LOCKDEP=n because trace_hardirqs_on_prepare()\nis a no-op when CONFIG_TRACE_IRQFLAGS is not set (TRACE_IRQFLAGS is\nselected by PROVE_LOCKING which selects LOCKDEP).\n\nFix:\nMove arch_interrupt_nmi_exit_prepare() to after the irqentry_nmi_exit()\nblock, so that:\n\n  irqentry_nmi_exit()                 // __nmi_exit() -> nmi_count--, in_nmi()=false\n  arch_interrupt_nmi_exit_prepare()   // now safe to restore soft mask state\n\nThe instrumentation inside irqentry_nmi_exit() now executes while\nin_nmi() is still true (nmi_count not yet decremented), but\nirq_soft_mask is still IRQS_ALL_DISABLED (NMI-entry value), so\narch_local_irq_restore() is never called with mask=0 from that path.\nAfter __nmi_exit() returns, arch_interrupt_nmi_exit_prepare() restores\nthe pre-NMI soft mask and irq_happened, which is the correct state for\nthe rfid back to the interrupted context.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-12-03 04:18:31","updated_at":"2026-12-03 04:18:31"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/94bf70c51f3766222d83b86f911f04dd49897e61","name":"https://git.kernel.org/stable/c/94bf70c51f3766222d83b86f911f04dd49897e61","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/8fa763bc3ee9bd215476ab91ee480c649eaa4b29","name":"https://git.kernel.org/stable/c/8fa763bc3ee9bd215476ab91ee480c649eaa4b29","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-142916","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142916","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc 94bf70c51f3766222d83b86f911f04dd49897e61 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc 8fa763bc3ee9bd215476ab91ee480c649eaa4b29 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 7.2","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.6 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":{"cve_year":"2026","cve_id":"142916","cve":"CVE-2026-142916","epss":"0.002740000","percentile":"0.212100000","score_date":"2026-12-03","updated_at":"2026-12-04 00:14:18"},"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["arch/powerpc/include/asm/interrupt.h"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"94bf70c51f3766222d83b86f911f04dd49897e61","status":"affected","version":"bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc","versionType":"git"},{"lessThan":"8fa763bc3ee9bd215476ab91ee480c649eaa4b29","status":"affected","version":"bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["arch/powerpc/include/asm/interrupt.h"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"7.2"},{"lessThan":"7.2","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.6","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.6","versionStartIncluding":"7.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"7.2","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc: fix NMI exit ordering: restore soft masks after irqentry_nmi_exit()\n\nWhen running with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y and LOCKDEP=y, an\nOops is triggered during NMI exit:\n\n  [  202.258332] Oops: Exception in kernel mode, sig: 4 [#1]\n  NIP [000000000003e178] 0x3e178\n  LR  [c00000000003e174] arch_local_irq_restore+0x2a4/0x328\n  TRAP: 0700  MSR: 0000000000081000 <ME>\n\nThe faulting instruction at NIP is a 'trap' (0fe00000) inside the\nrfi_flush_fallback trampoline at a userspace-looking low address, reached\nafter a bad rfid caused by an incorrect SRR0 value.\n\nRoot cause:\nDEFINE_INTERRUPT_HANDLER_NMI used to call arch_interrupt_nmi_exit_prepare()\n*before* irqentry_nmi_exit(), giving this sequence:\n\n  arch_interrupt_nmi_enter_prepare()   // saves irq_soft_mask, irq_happened\n  irqentry_nmi_enter()                 // __nmi_enter() -> nmi_count++, in_nmi()=true\n  ____func(regs)                       // NMI handler body\n  arch_interrupt_nmi_exit_prepare()    // RESTORES irq_soft_mask=0 (IRQS_ENABLED)\n                                       // RESTORES irq_happened with pending bits\n  irqentry_nmi_exit()                  // instrumentation block runs here...\n    trace_hardirqs_on_prepare()        //   ...with in_nmi()==true still\n    lockdep_hardirqs_on_prepare()      //   ...and irq_soft_mask already restored to 0\n      -> arch_local_irq_restore(0)     // mask=0 -> enable path entered\n           WARN_ON_ONCE(in_nmi())      // FIRES: __nmi_exit() hasn't run yet\n    __nmi_exit()                       // nmi_count-- (too late)\n\narch_interrupt_nmi_exit_prepare() restores irq_soft_mask to whatever\nthe interrupted thread had (IRQS_ENABLED / 0) and restores irq_happened\nwith any pending deferred-interrupt bits that were present when the NMI\nfired.  This is correct and necessary before rfid back to the interrupted\ncontext, but it must not happen until irqentry_nmi_exit() has fully\ncompleted.\n\nWith irq_soft_mask=0 and pending bits in irq_happened, the\ntrace_hardirqs_on_prepare() call inside irqentry_nmi_exit()'s\ninstrumentation block reaches lockdep_hardirqs_on_prepare() which\ncalls __trace_hardirqs_on_caller(), which eventually calls\narch_local_irq_restore(0) (the IRQS_ENABLED / enable path).\n\narch_local_irq_restore() with mask=0 hits the CONFIG_PPC_IRQ_SOFT_MASK_DEBUG\nguards at irq_64.c:217:\n\n  WARN_ON_ONCE(in_nmi());   // TRUE: __nmi_exit() not yet called\n\nThe WARN_ON_ONCE fires a 'trap' instruction (tw 31,0,0 / 0fe00000) in\nkernel mode with MSR_PR=0, MSR_IR=0 (real-mode).  The program check\nhandler (TRAP 0700) takes the sig:4 (SIGILL) path via do_program_check()\nand calls die(), producing the Oops.\n\nThe RESTART_TABLE mechanism in arch_local_irq_restore then causes the\nbad rfid that lands at the userspace-looking address visible in the NIP.\n\nThe bug is invisible with LOCKDEP=n because trace_hardirqs_on_prepare()\nis a no-op when CONFIG_TRACE_IRQFLAGS is not set (TRACE_IRQFLAGS is\nselected by PROVE_LOCKING which selects LOCKDEP).\n\nFix:\nMove arch_interrupt_nmi_exit_prepare() to after the irqentry_nmi_exit()\nblock, so that:\n\n  irqentry_nmi_exit()                 // __nmi_exit() -> nmi_count--, in_nmi()=false\n  arch_interrupt_nmi_exit_prepare()   // now safe to restore soft mask state\n\nThe instrumentation inside irqentry_nmi_exit() now executes while\nin_nmi() is still true (nmi_count not yet decremented), but\nirq_soft_mask is still IRQS_ALL_DISABLED (NMI-entry value), so\narch_local_irq_restore() is never called with mask=0 from that path.\nAfter __nmi_exit() returns, arch_interrupt_nmi_exit_prepare() restores\nthe pre-NMI soft mask and irq_happened, which is the correct state for\nthe rfid back to the interrupted context."}],"providerMetadata":{"dateUpdated":"2026-12-03T03:25:57.218Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/94bf70c51f3766222d83b86f911f04dd49897e61"},{"url":"https://git.kernel.org/stable/c/8fa763bc3ee9bd215476ab91ee480c649eaa4b29"}],"title":"powerpc: fix NMI exit ordering: restore soft masks after irqentry_nmi_exit()","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-142916","datePublished":"2026-12-03T03:25:57.218Z","dateReserved":"2026-12-03T03:10:28.337Z","dateUpdated":"2026-12-03T03:25:57.218Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-12-03 04:18:31","lastModifiedDate":"2026-12-03 04:18:31","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"142916","Ordinal":"1","Title":"powerpc: fix NMI exit ordering: restore soft masks after irqentr","CVE":"CVE-2026-142916","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"142916","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc: fix NMI exit ordering: restore soft masks after irqentry_nmi_exit()\n\nWhen running with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y and LOCKDEP=y, an\nOops is triggered during NMI exit:\n\n  [  202.258332] Oops: Exception in kernel mode, sig: 4 [#1]\n  NIP [000000000003e178] 0x3e178\n  LR  [c00000000003e174] arch_local_irq_restore+0x2a4/0x328\n  TRAP: 0700  MSR: 0000000000081000 <ME>\n\nThe faulting instruction at NIP is a 'trap' (0fe00000) inside the\nrfi_flush_fallback trampoline at a userspace-looking low address, reached\nafter a bad rfid caused by an incorrect SRR0 value.\n\nRoot cause:\nDEFINE_INTERRUPT_HANDLER_NMI used to call arch_interrupt_nmi_exit_prepare()\n*before* irqentry_nmi_exit(), giving this sequence:\n\n  arch_interrupt_nmi_enter_prepare()   // saves irq_soft_mask, irq_happened\n  irqentry_nmi_enter()                 // __nmi_enter() -> nmi_count++, in_nmi()=true\n  ____func(regs)                       // NMI handler body\n  arch_interrupt_nmi_exit_prepare()    // RESTORES irq_soft_mask=0 (IRQS_ENABLED)\n                                       // RESTORES irq_happened with pending bits\n  irqentry_nmi_exit()                  // instrumentation block runs here...\n    trace_hardirqs_on_prepare()        //   ...with in_nmi()==true still\n    lockdep_hardirqs_on_prepare()      //   ...and irq_soft_mask already restored to 0\n      -> arch_local_irq_restore(0)     // mask=0 -> enable path entered\n           WARN_ON_ONCE(in_nmi())      // FIRES: __nmi_exit() hasn't run yet\n    __nmi_exit()                       // nmi_count-- (too late)\n\narch_interrupt_nmi_exit_prepare() restores irq_soft_mask to whatever\nthe interrupted thread had (IRQS_ENABLED / 0) and restores irq_happened\nwith any pending deferred-interrupt bits that were present when the NMI\nfired.  This is correct and necessary before rfid back to the interrupted\ncontext, but it must not happen until irqentry_nmi_exit() has fully\ncompleted.\n\nWith irq_soft_mask=0 and pending bits in irq_happened, the\ntrace_hardirqs_on_prepare() call inside irqentry_nmi_exit()'s\ninstrumentation block reaches lockdep_hardirqs_on_prepare() which\ncalls __trace_hardirqs_on_caller(), which eventually calls\narch_local_irq_restore(0) (the IRQS_ENABLED / enable path).\n\narch_local_irq_restore() with mask=0 hits the CONFIG_PPC_IRQ_SOFT_MASK_DEBUG\nguards at irq_64.c:217:\n\n  WARN_ON_ONCE(in_nmi());   // TRUE: __nmi_exit() not yet called\n\nThe WARN_ON_ONCE fires a 'trap' instruction (tw 31,0,0 / 0fe00000) in\nkernel mode with MSR_PR=0, MSR_IR=0 (real-mode).  The program check\nhandler (TRAP 0700) takes the sig:4 (SIGILL) path via do_program_check()\nand calls die(), producing the Oops.\n\nThe RESTART_TABLE mechanism in arch_local_irq_restore then causes the\nbad rfid that lands at the userspace-looking address visible in the NIP.\n\nThe bug is invisible with LOCKDEP=n because trace_hardirqs_on_prepare()\nis a no-op when CONFIG_TRACE_IRQFLAGS is not set (TRACE_IRQFLAGS is\nselected by PROVE_LOCKING which selects LOCKDEP).\n\nFix:\nMove arch_interrupt_nmi_exit_prepare() to after the irqentry_nmi_exit()\nblock, so that:\n\n  irqentry_nmi_exit()                 // __nmi_exit() -> nmi_count--, in_nmi()=false\n  arch_interrupt_nmi_exit_prepare()   // now safe to restore soft mask state\n\nThe instrumentation inside irqentry_nmi_exit() now executes while\nin_nmi() is still true (nmi_count not yet decremented), but\nirq_soft_mask is still IRQS_ALL_DISABLED (NMI-entry value), so\narch_local_irq_restore() is never called with mask=0 from that path.\nAfter __nmi_exit() returns, arch_interrupt_nmi_exit_prepare() restores\nthe pre-NMI soft mask and irq_happened, which is the correct state for\nthe rfid back to the interrupted context.","Type":"Description","Title":"powerpc: fix NMI exit ordering: restore soft masks after irqentr"}]}}}