CVE-2024-38588: ftrace: Fix possible use-after-free issue in ftrace_location()
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().
Security readout for executives and security teams
Plain-English summary
CVE-2024-38588 is a Linux kernel use-after-free in ftrace handling during module activity. A local user with relevant privileges could hit a race between kprobe registration and module deletion, potentially compromising kernel confidentiality, integrity, or availability. The source bundle does not show public exploitation.
Executive priority
High priority for Linux fleets with local users or shared administration models. Schedule patching through normal kernel maintenance urgently, but do not treat this as confirmed active exploitation based on the provided sources.
Technical view
The flaw is in ftrace_location()/lookup_rec(), where ftrace records can be read while module ftrace pages are freed by ftrace_release_mod(). The fix uses ftrace_location_range(), protects ftrace page access with RCU, and synchronizes RCU before freeing ftrace pages in several paths.
Likely exposure
Exposure is limited to systems running affected Linux kernel versions listed by the CVE data. Risk is higher where untrusted local users, module loading, kprobes, tracing, or similar kernel instrumentation paths are available.
Exploitation context
The CVSS vector is local, low complexity, low privileges, and no user interaction. KEV is false, and the provided sources do not cite active exploitation or a public exploit. Treat this as serious local privilege boundary risk, not confirmed internet-scale exploitation.
Researcher notes
The key condition is a race between ftrace record lookup and freeing module ftrace pages. Validation should focus on kernel version, downstream backports, and whether the fix’s RCU protections and synchronize_rcu() calls are present.
Mitigation direction
Update to a kernel build containing the referenced stable fixes.
Apply vendor kernel advisories for your distribution, including Debian LTS where applicable.
Prioritize multi-user servers, developer hosts, and systems allowing kernel modules or tracing.
Restrict local shell access and module-loading privileges where operationally feasible.
Monitor vendor guidance for backported fixes on supported kernel branches.
Validation and detection
Inventory Linux kernel versions across servers, containers hosts, and appliances.
Compare installed kernels against vendor advisories and the CVE affected version data.
Confirm kernel packages include the relevant stable ftrace fix commits.
Check whether kprobes, ftrace, and module loading are enabled or exposed.
Verify no unsupported or custom kernels remain unpatched.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-416: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
2ADP providers
10Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-416 · source CWE mapping
Use After Free
Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.