Skip to main content

CVE-2024-41087: Vulnerability in Linux Linux

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

Description

In the Linux kernel, the following vulnerability has been resolved: ata: libata-core: Fix double free on error If e.g. the ata_port_alloc() call in ata_host_alloc() fails, we will jump to the err_out label, which will call devres_release_group(). devres_release_group() will trigger a call to ata_host_release(). ata_host_release() calls kfree(host), so executing the kfree(host) in ata_host_alloc() will lead to a double free: kernel BUG at mm/slub.c:553! Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 11 PID: 599 Comm: (udev-worker) Not tainted 6.10.0-rc5 #47 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014 RIP: 0010:kfree+0x2cf/0x2f0 Code: 5d 41 5e 41 5f 5d e9 80 d6 ff ff 4d 89 f1 41 b8 01 00 00 00 48 89 d9 48 89 da RSP: 0018:ffffc90000f377f0 EFLAGS: 00010246 RAX: ffff888112b1f2c0 RBX: ffff888112b1f2c0 RCX: ffff888112b1f320 RDX: 000000000000400b RSI: ffffffffc02c9de5 RDI: ffff888112b1f2c0 RBP: ffffc90000f37830 R08: 0000000000000000 R09: 0000000000000000 R10: ffffc90000f37610 R11: 617461203a736b6e R12: ffffea00044ac780 R13: ffff888100046400 R14: ffffffffc02c9de5 R15: 0000000000000006 FS: 00007f2f1cabe980(0000) GS:ffff88813b380000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2f1c3acf75 CR3: 0000000111724000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: <TASK> ? __die_body.cold+0x19/0x27 ? die+0x2e/0x50 ? do_trap+0xca/0x110 ? do_error_trap+0x6a/0x90 ? kfree+0x2cf/0x2f0 ? exc_invalid_op+0x50/0x70 ? kfree+0x2cf/0x2f0 ? asm_exc_invalid_op+0x1a/0x20 ? ata_host_alloc+0xf5/0x120 [libata] ? ata_host_alloc+0xf5/0x120 [libata] ? kfree+0x2cf/0x2f0 ata_host_alloc+0xf5/0x120 [libata] ata_host_alloc_pinfo+0x14/0xa0 [libata] ahci_init_one+0x6c9/0xd20 [ahci] Ensure that we will not call kfree(host) twice, by performing the kfree() only if the devres_open_group() call failed.

AI-Powered Analysis

AILast updated: 06/29/2025, 04:26:26 UTC

Technical Analysis

CVE-2024-41087 is a vulnerability identified in the Linux kernel's ATA subsystem, specifically within the libata-core component responsible for handling ATA host allocation and release. The flaw arises from a double free condition triggered when the ata_port_alloc() call within ata_host_alloc() fails. In this failure scenario, the error handling code jumps to an err_out label that calls devres_release_group(), which in turn invokes ata_host_release(). The ata_host_release() function calls kfree(host) to free allocated memory. However, the original ata_host_alloc() function also calls kfree(host) after the failure, leading to the same memory being freed twice. This double free results in a kernel BUG, causing an invalid opcode exception and a kernel oops, which can crash the system or cause undefined behavior. The vulnerability was identified in Linux kernel version 6.10.0-rc5 and is related to memory management errors in the ATA host allocation process. The fix involves ensuring that kfree(host) is only called once by conditioning the call on whether devres_open_group() failed, preventing the double free scenario. Although no known exploits are reported in the wild, the vulnerability can lead to system instability or denial of service due to kernel crashes triggered by the double free error. The vulnerability does not require user interaction or authentication to be triggered, as it is related to kernel-level memory management during device initialization or error handling in the ATA subsystem.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running vulnerable Linux kernel versions that include the affected ATA subsystem code. The impact includes potential denial of service through kernel crashes, which can disrupt critical services, especially in environments relying on Linux servers for storage management or data center operations. Systems using ATA devices or AHCI controllers are particularly at risk. The vulnerability could affect cloud service providers, enterprises, and public sector organizations that deploy Linux-based infrastructure. While there is no evidence of remote code execution or privilege escalation, the instability caused by kernel panics can lead to downtime, data unavailability, and operational disruption. In sectors such as finance, healthcare, and critical infrastructure within Europe, such disruptions could have significant operational and regulatory consequences. Additionally, the vulnerability could be exploited by attackers with local access to cause denial of service, impacting multi-tenant environments or shared hosting platforms common in European data centers.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel to versions where this vulnerability is patched, ensuring the fix that prevents the double free condition is applied. Specifically, kernel versions released after the fix for CVE-2024-41087 should be deployed. System administrators should audit their Linux systems to identify vulnerable kernel versions, especially on servers handling ATA devices or AHCI controllers. For environments where immediate patching is not feasible, mitigating risk includes restricting local access to trusted users only, as exploitation requires local code execution or triggering of the vulnerable code path. Monitoring kernel logs for oops or BUG messages related to kfree or ata_host_alloc failures can help detect attempted exploitation or system instability. Additionally, organizations should implement robust backup and recovery procedures to minimize downtime impact. For critical infrastructure, consider deploying kernel live patching solutions that can apply fixes without rebooting, reducing service disruption. Finally, coordinate with Linux distribution vendors and security teams to receive timely updates and advisories.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9827c4522896dcbe186b

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

Last enriched: 6/29/2025, 4:26:26 AM

Last updated: 8/3/2025, 12:39:44 AM

Views: 16

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