Skip to main content

CVE-2024-38588: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-38588cvecve-2024-38588
Published: Wed Jun 19 2024 (06/19/2024, 13:37:43 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: ftrace: Fix possible use-after-free issue in ftrace_location() KASAN reports a bug: BUG: KASAN: use-after-free in ftrace_location+0x90/0x120 Read of size 8 at addr ffff888141d40010 by task insmod/424 CPU: 8 PID: 424 Comm: insmod Tainted: G W 6.9.0-rc2+ [...] Call Trace: <TASK> dump_stack_lvl+0x68/0xa0 print_report+0xcf/0x610 kasan_report+0xb5/0xe0 ftrace_location+0x90/0x120 register_kprobe+0x14b/0xa40 kprobe_init+0x2d/0xff0 [kprobe_example] do_one_initcall+0x8f/0x2d0 do_init_module+0x13a/0x3c0 load_module+0x3082/0x33d0 init_module_from_file+0xd2/0x130 __x64_sys_finit_module+0x306/0x440 do_syscall_64+0x68/0x140 entry_SYSCALL_64_after_hwframe+0x71/0x79 The root cause is that, in lookup_rec(), ftrace record of some address is being searched in ftrace pages of some module, but those ftrace pages at the same time is being freed in ftrace_release_mod() as the corresponding module is being deleted: CPU1 | CPU2 register_kprobes() { | delete_module() { check_kprobe_address_safe() { | arch_check_ftrace_location() { | ftrace_location() { | lookup_rec() // USE! | ftrace_release_mod() // Free! To fix this issue: 1. Hold rcu lock as accessing ftrace pages in ftrace_location_range(); 2. Use ftrace_location_range() instead of lookup_rec() in ftrace_location(); 3. Call synchronize_rcu() before freeing any ftrace pages both in ftrace_process_locs()/ftrace_release_mod()/ftrace_free_mem().

AI-Powered Analysis

AILast updated: 07/03/2025, 00:56:05 UTC

Technical Analysis

CVE-2024-38588 is a high-severity use-after-free vulnerability in the Linux kernel's ftrace subsystem, specifically within the ftrace_location() function. Ftrace is a kernel tracing utility used for debugging and performance monitoring. The vulnerability arises due to a race condition between two CPUs: one CPU executing register_kprobes() which calls ftrace_location() and internally lookup_rec() to search for ftrace records, while another CPU concurrently deletes a kernel module triggering ftrace_release_mod() which frees the ftrace pages associated with that module. This concurrency leads to a use-after-free condition where ftrace_location() accesses memory that has already been freed, causing potential kernel crashes or arbitrary code execution. The root cause is the lack of proper synchronization when accessing ftrace pages during module unloading. The fix involves holding an RCU (Read-Copy-Update) lock when accessing ftrace pages, replacing lookup_rec() with ftrace_location_range() which is RCU-safe, and calling synchronize_rcu() before freeing ftrace pages to ensure no references remain. The vulnerability affects Linux kernel versions around 6.9.0-rc2+ and is identified as CWE-416 (Use After Free). The CVSS v3.1 score is 7.8 (high), with attack vector local, low attack complexity, low privileges required, no user interaction, and high impact on confidentiality, integrity, and availability. No known exploits are reported in the wild yet. This vulnerability could be triggered by loading or unloading kernel modules (e.g., via insmod or rmmod), which is a common administrative operation on Linux systems.

Potential Impact

For European organizations, this vulnerability poses a significant risk especially for those relying on Linux-based servers, embedded systems, or infrastructure devices that load kernel modules dynamically. Exploitation could allow a local attacker with limited privileges to cause denial of service via kernel crashes or potentially escalate privileges by executing arbitrary code in kernel space. This could lead to system downtime, data breaches, or compromise of critical infrastructure. Given the widespread use of Linux in European data centers, cloud providers, telecom infrastructure, and industrial control systems, the impact could be broad. Organizations running containerized workloads or virtualized environments on Linux hosts may also be affected if kernel modules are loaded dynamically. The vulnerability undermines the integrity and availability of systems, which could disrupt business operations and critical services. Although exploitation requires local access and some privileges, insider threats or attackers who have gained foothold could leverage this flaw to escalate privileges or evade detection.

Mitigation Recommendations

1. Apply the official Linux kernel patches that address this vulnerability as soon as they become available. Monitor kernel updates from trusted sources and prioritize deployment in production environments. 2. Restrict the ability to load or unload kernel modules to highly trusted administrators only, minimizing the attack surface. 3. Implement strict access controls and auditing on module loading commands (insmod, modprobe, rmmod) to detect suspicious activities. 4. Use kernel lockdown features where possible to prevent unauthorized module loading. 5. For environments where patching is delayed, consider disabling dynamic module loading if feasible, or use kernel configurations that limit module operations. 6. Employ runtime security tools that monitor kernel integrity and detect anomalous behavior indicative of exploitation attempts. 7. Conduct regular security assessments and penetration tests focusing on privilege escalation vectors involving kernel modules. 8. Educate system administrators about the risks of loading untrusted modules and the importance of timely patching.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-06-18T19:36:34.929Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d9829c4522896dcbe2a4f

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

Last enriched: 7/3/2025, 12:56:05 AM

Last updated: 8/13/2025, 7:55:55 PM

Views: 11

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