CVE-2024-41096·Kernel vulnerability
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 ]
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.9.8
- Published
- 2024-07-29
Affected versions
From: 6.7
Until: 6.9.8
Fixed in: 6.9.8
How to fix this CVE
Update your Linux kernel to version 6.9.8 or later to resolve a use-after-free vulnerability in the PCI/MSI (Message Signaled Interrupts) subsystem. The vulnerability occurs when MSI capability initialization fails, causing the kernel to access freed descriptor memory during error handling. Immediate kernel patching and system reboot are required to eliminate exposure.
sudo dnf update kernel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Run 'uname -r' to retrieve the currently installed kernel version and compare against affected versions 6.7 through 6.9.7
- Execute 'grep -i msi /proc/interrupts' to verify if MSI interrupts are active on your hardware (indicates MSI subsystem is in use)
- Search system logs with 'journalctl -b | grep -i "use.after.free\|msi\|kfence\|uaf"' to detect kernel memory safety warnings related to MSI
- Confirm patch application by running 'uname -r' after reboot and verifying kernel version is 6.9.8 or later
FAQ
What is CVE-2024-41096?
CVE-2024-41096 is a use-after-free vulnerability in the Linux kernel's PCI/MSI (Message Signaled Interrupts) initialization code. When MSI capability setup encounters an error during IRQ allocation, the kernel attempts to unmask a descriptor that was already freed from memory, potentially leading to privilege escalation or denial of service.
Is CVE-2024-41096 being actively exploited?
No, CVE-2024-41096 is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are currently available. However, the high CVSS score (7.8) warrants prompt patching.
What versions of Kernel are affected by CVE-2024-41096?
Linux kernel versions 6.7.0 through 6.9.7 are vulnerable. Kernel 6.9.8 and later versions contain the fix.
How do I check if my server is vulnerable to CVE-2024-41096?
Run 'uname -r' and check if the output version is between 6.7.0 and 6.9.7. If it falls within this range, your system is vulnerable and requires immediate patching.
Does Defensia detect CVE-2024-41096?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2024-41096 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/0ae40b2d0a5de6b045504098e365d4fdff5bbeba
- https://git.kernel.org/stable/c/45fc8d20e0768ab0a0ad054081d0f68aa3c83976
- https://git.kernel.org/stable/c/9eee5330656bf92f51cb1f09b2dc9f8cf975b3d1
- https://git.kernel.org/stable/c/ff1121d2214b794dc1772081f27bdd90721a84bc
- https://git.kernel.org/stable/c/45fc8d20e0768ab0a0ad054081d0f68aa3c83976
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-41096. Free for 1 server.
Get started free