Skip to main content

CVE-2024-41096: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-41096cvecve-2024-41096
Published: Mon Jul 29 2024 (07/29/2024, 15:48:09 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: PCI/MSI: Fix UAF in msi_capability_init KFENCE reports the following UAF: BUG: KFENCE: use-after-free read in __pci_enable_msi_range+0x2c0/0x488 Use-after-free read at 0x0000000024629571 (in kfence-#12): __pci_enable_msi_range+0x2c0/0x488 pci_alloc_irq_vectors_affinity+0xec/0x14c pci_alloc_irq_vectors+0x18/0x28 kfence-#12: 0x0000000008614900-0x00000000e06c228d, size=104, cache=kmalloc-128 allocated by task 81 on cpu 7 at 10.808142s: __kmem_cache_alloc_node+0x1f0/0x2bc kmalloc_trace+0x44/0x138 msi_alloc_desc+0x3c/0x9c msi_domain_insert_msi_desc+0x30/0x78 msi_setup_msi_desc+0x13c/0x184 __pci_enable_msi_range+0x258/0x488 pci_alloc_irq_vectors_affinity+0xec/0x14c pci_alloc_irq_vectors+0x18/0x28 freed by task 81 on cpu 7 at 10.811436s: msi_domain_free_descs+0xd4/0x10c msi_domain_free_locked.part.0+0xc0/0x1d8 msi_domain_alloc_irqs_all_locked+0xb4/0xbc pci_msi_setup_msi_irqs+0x30/0x4c __pci_enable_msi_range+0x2a8/0x488 pci_alloc_irq_vectors_affinity+0xec/0x14c pci_alloc_irq_vectors+0x18/0x28 Descriptor allocation done in: __pci_enable_msi_range msi_capability_init msi_setup_msi_desc msi_insert_msi_desc msi_domain_insert_msi_desc msi_alloc_desc ... Freed in case of failure in __msi_domain_alloc_locked() __pci_enable_msi_range msi_capability_init pci_msi_setup_msi_irqs msi_domain_alloc_irqs_all_locked msi_domain_alloc_locked __msi_domain_alloc_locked => fails msi_domain_free_locked ... That failure propagates back to pci_msi_setup_msi_irqs() in msi_capability_init() which accesses the descriptor for unmasking in the error exit path. Cure it by copying the descriptor and using the copy for the error exit path unmask operation. [ tglx: Massaged change log ]

AI-Powered Analysis

AILast updated: 06/29/2025, 04:40:13 UTC

Technical Analysis

CVE-2024-41096 is a use-after-free (UAF) vulnerability identified in the Linux kernel's PCI/MSI (Message Signaled Interrupts) subsystem, specifically within the function __pci_enable_msi_range. The vulnerability arises due to improper handling of MSI descriptor objects during the MSI capability initialization process. When the kernel attempts to allocate MSI descriptors and subsequently encounters a failure in the allocation routine (__msi_domain_alloc_locked), it frees the descriptor but continues to access it in the error exit path, leading to a use-after-free condition. This flaw was detected by KFENCE, a kernel memory error detector, which reported a use-after-free read in __pci_enable_msi_range. The root cause is that the error handling path uses the original descriptor pointer after it has been freed, rather than a safe copy. The fix involves copying the MSI descriptor and using this copy for the error exit path unmask operation, preventing access to freed memory. This vulnerability affects Linux kernel versions identified by the commit hash bf6e054e0e3fbc9614355b760e18c8a14f952a4e and potentially other versions containing the same code pattern. Since MSI is a critical mechanism for PCI devices to signal interrupts, this vulnerability could impact a wide range of hardware platforms running vulnerable Linux kernels.

Potential Impact

For European organizations, the impact of CVE-2024-41096 can be significant, especially for those relying on Linux-based infrastructure with PCI devices utilizing MSI for interrupt handling. Exploitation of this use-after-free vulnerability could lead to kernel crashes (denial of service), potential escalation of privileges, or arbitrary code execution in kernel context if an attacker can manipulate the PCI/MSI subsystem. This could disrupt critical services, including cloud environments, data centers, and embedded systems common in industrial control, telecommunications, and financial sectors across Europe. Given the kernel-level nature of the flaw, successful exploitation undermines system integrity and availability, potentially leading to operational downtime and data breaches. Although no known exploits are reported in the wild yet, the vulnerability's presence in the Linux kernel—a widely deployed OS in Europe—means that attackers with local or privileged access could leverage it to compromise systems. The impact is heightened in environments with multi-tenant virtualization or containerized workloads where kernel security is paramount.

Mitigation Recommendations

To mitigate CVE-2024-41096, European organizations should: 1) Apply the official Linux kernel patches that address this vulnerability as soon as they become available from trusted sources or distribution vendors. 2) Monitor kernel updates from major Linux distributions (e.g., Debian, Ubuntu, Red Hat, SUSE) and prioritize deployment in production and critical systems. 3) Implement strict access controls to limit local user privileges, reducing the risk of exploitation by unprivileged users. 4) Employ kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR) and Kernel Page Table Isolation (KPTI) to increase exploitation difficulty. 5) Use runtime security tools and kernel integrity monitoring to detect anomalous behavior indicative of exploitation attempts. 6) For environments using PCI devices extensively, conduct thorough testing of kernel updates to ensure stability and compatibility. 7) Maintain comprehensive incident response plans to quickly address potential exploitation scenarios. These steps go beyond generic advice by emphasizing patch management, privilege restriction, and proactive detection tailored to kernel-level vulnerabilities in PCI/MSI subsystems.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-12T12:17:45.637Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9827c4522896dcbe18ce

Added to database: 5/21/2025, 9:08:55 AM

Last enriched: 6/29/2025, 4:40:13 AM

Last updated: 8/4/2025, 12:46:40 AM

Views: 15

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