Skip to main content

CVE-2024-42126: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-42126cvecve-2024-42126
Published: Tue Jul 30 2024 (07/30/2024, 07:46:23 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt. nmi_enter()/nmi_exit() touches per cpu variables which can lead to kernel crash when invoked during real mode interrupt handling (e.g. early HMI/MCE interrupt handler) if percpu allocation comes from vmalloc area. Early HMI/MCE handlers are called through DEFINE_INTERRUPT_HANDLER_NMI() wrapper which invokes nmi_enter/nmi_exit calls. We don't see any issue when percpu allocation is from the embedded first chunk. However with CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK enabled there are chances where percpu allocation can come from the vmalloc area. With kernel command line "percpu_alloc=page" we can force percpu allocation to come from vmalloc area and can see kernel crash in machine_check_early: [ 1.215714] NIP [c000000000e49eb4] rcu_nmi_enter+0x24/0x110 [ 1.215717] LR [c0000000000461a0] machine_check_early+0xf0/0x2c0 [ 1.215719] --- interrupt: 200 [ 1.215720] [c000000fffd73180] [0000000000000000] 0x0 (unreliable) [ 1.215722] [c000000fffd731b0] [0000000000000000] 0x0 [ 1.215724] [c000000fffd73210] [c000000000008364] machine_check_early_common+0x134/0x1f8 Fix this by avoiding use of nmi_enter()/nmi_exit() in real mode if percpu first chunk is not embedded.

AI-Powered Analysis

AILast updated: 07/04/2025, 05:10:39 UTC

Technical Analysis

CVE-2024-42126 is a vulnerability identified in the Linux kernel affecting the PowerPC architecture. The issue arises from the use of the nmi_enter() and nmi_exit() functions during real mode interrupt handling, specifically in early Machine Check Interrupt (MCI) or Hardware Machine Interface (HMI) interrupt handlers. These functions manipulate per-CPU variables, which can lead to kernel crashes if the per-CPU memory allocation is sourced from the vmalloc area rather than the embedded first chunk. This condition can be triggered when the kernel is booted with the command line parameter "percpu_alloc=page", forcing per-CPU allocations to come from vmalloc. The vulnerability manifests as a kernel crash during early machine check handling, as evidenced by kernel logs showing faults in rcu_nmi_enter and machine_check_early functions. The root cause is that nmi_enter()/nmi_exit() are unsafe to call in real mode interrupts when per-CPU variables are allocated from vmalloc, as these functions expect embedded per-CPU memory. The fix involves avoiding calls to nmi_enter()/nmi_exit() in real mode interrupts if the per-CPU first chunk is not embedded, preventing the kernel crash scenario. This vulnerability is specific to the PowerPC architecture and certain kernel configurations involving per-CPU memory allocation strategies. No known exploits are reported in the wild as of the publication date, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the impact of CVE-2024-42126 primarily concerns systems running Linux kernels on PowerPC architectures, which are less common than x86 but still used in specialized environments such as embedded systems, telecommunications infrastructure, and certain industrial control systems. A kernel crash caused by this vulnerability could lead to denial of service (DoS), disrupting critical services and operations. In environments where uptime and reliability are crucial—such as financial institutions, healthcare providers, and critical infrastructure operators—such crashes could cause significant operational disruption and potential data loss if systems are not properly hardened or if failover mechanisms are inadequate. Although this vulnerability does not directly expose confidentiality or integrity risks, the availability impact could be severe in affected systems. The lack of known exploits reduces immediate risk, but organizations using affected kernel versions should prioritize patching to avoid unexpected outages. The vulnerability's specificity to PowerPC and certain kernel configurations limits its scope, but organizations relying on customized or legacy Linux kernels with these settings remain at risk.

Mitigation Recommendations

European organizations should take the following specific mitigation steps: 1) Identify and inventory all Linux systems running on PowerPC architectures, especially those using customized kernel configurations with per-CPU allocations potentially sourced from vmalloc. 2) Apply the official Linux kernel patches that address CVE-2024-42126 as soon as they become available from trusted sources or Linux distributions. 3) Avoid using the kernel boot parameter "percpu_alloc=page" unless absolutely necessary, as it can trigger the vulnerable condition. 4) Implement robust monitoring of kernel logs for early signs of machine check exceptions or unexpected kernel crashes related to NMI handling. 5) For critical systems, consider deploying redundancy and failover mechanisms to mitigate the impact of potential kernel crashes. 6) Engage with Linux distribution vendors to confirm that their kernel packages include the fix and to receive timely updates. 7) Test patches in staging environments to ensure stability before production deployment, given the low-level nature of the fix. These steps go beyond generic advice by focusing on architecture-specific configurations and kernel boot parameters that influence exploitability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-29T15:50:41.179Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682cd0fa1484d88663aec014

Added to database: 5/20/2025, 6:59:06 PM

Last enriched: 7/4/2025, 5:10:39 AM

Last updated: 7/30/2025, 11:49:56 PM

Views: 8

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats