{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2026-142916",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2026-12-03T03:10:28.337Z",
        "datePublished": "2026-12-03T03:25:57.218Z",
        "dateUpdated": "2026-12-03T03:25:57.218Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-12-03T03:25:57.218Z"
            },
            "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."
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/powerpc/include/asm/interrupt.h"
                    ],
                    "versions": [
                        {
                            "version": "bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc",
                            "lessThan": "94bf70c51f3766222d83b86f911f04dd49897e61",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "bee25f97ad24641df55cb3887eb5bfcb2b9d8fbc",
                            "lessThan": "8fa763bc3ee9bd215476ab91ee480c649eaa4b29",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/powerpc/include/asm/interrupt.h"
                    ],
                    "versions": [
                        {
                            "version": "7.2",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "7.2",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.3.6",
                            "lessThanOrEqual": "7.3.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.4-rc1",
                            "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": "7.2",
                                    "versionEndExcluding": "7.3.6"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "7.2",
                                    "versionEndExcluding": "7.4-rc1"
                                }
                            ]
                        }
                    ]
                }
            ],
            "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"
            }
        }
    }
}