CVE-2024-38588 json
ftrace: Fix possible use-after-free issue in ftrace_location()
published 2024-06-19 2 y ago modified 2026-08-05 3 mo ago also EUVD-2024-37451
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 14%
- public exploits
- 0
- none known
Summary
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().
Patch / fix
- Linux Linux 5.4.286, 5.10.227, 5.15.162, 6.1.93, 6.6.33, 6.8.12, 6.9.3, 6.10
- linux Debian 12 6.1.94-1
- linux Debian 14, Debian 13 6.8.12-1
debian advisories DEBIAN-CVE-2024-38588
- linux Ubuntu 20.04 LTS 5.4.0-211.231
- linux Ubuntu 22.04 LTS 5.15.0-121.131
- linux Ubuntu 24.04 LTS 6.8.0-40.40
- linux-aws Ubuntu 20.04 LTS 5.4.0-1142.152
- linux-aws Ubuntu 22.04 LTS 5.15.0-1069.75
- linux-aws Ubuntu 24.04 LTS 6.8.0-1013.14
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1145.154
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1068.76
ubuntu advisories UBUNTU-CVE-2024-38588
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-rt Linux Micro 6.0 6.4.0-9.1
- kernel-source-rt Linux Micro 6.0 6.4.0-9.1
- kernel-source Linux Micro 6.0 6.4.0-18.1
- kernel-default Linux Micro 6.0 6.4.0-18.1
- kernel-kvmsmall Linux Micro 6.0 6.4.0-18.1
- kernel-default-base Linux Micro 6.0 6.4.0-17.1.1.51
- kernel-rt Real Time Module 15 SP6, openSUSE Leap 15.6 6.4.0-150600.10.5.1
- kernel-syms-rt Real Time Module 15 SP6, openSUSE Leap 15.6 6.4.0-150600.10.5.1
suse advisories SUSE-SU-2025:02334-1SUSE-SU-2025:20028-1SUSE-SU-2025:20008-1SUSE-SU-2024:2973-1SUSE-SU-2024:2947-1SUSE-SU-2024:2939-1
- git.kernel.org/stable/c/eea46baf145150910ba134f75a67106ba2222c1b commit
- git.kernel.org/stable/c/1880a324af1c95940a7c954b6b937e86844a33bd commit
- git.kernel.org/stable/c/8ea8ef5e42173560ac510e92a1cc797ffeea8831 commit
- git.kernel.org/stable/c/dbff5f0bfb2416b8b55c105ddbcd4f885e98fada commit
- git.kernel.org/stable/c/7b4881da5b19f65709f5c18c1a4d8caa2e496461 commit
- git.kernel.org/stable/c/66df065b3106964e667b37bf8f7e55ec69d0c1f6 commit
- git.kernel.org/stable/c/31310e373f4c8c74e029d4326b283e757edabc0b commit
- git.kernel.org/stable/c/e60b613df8b6253def41215402f72986fee3fc8d commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-38588 updated cvss 5.2
kernel: ftrace: Fix possible use-after-free issue in ftrace_location()
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 moreaffected: no fix available “Fix deferred”
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
0.24% chance of exploitation in the next 30 days, higher than 14% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CISA ADP | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-416 Use After Free
- Technology feeds
References
-
git.kernel.org
/stable/c/eea46baf145150910ba134f75a67106ba2222c1b
patch
-
git.kernel.org
/stable/c/1880a324af1c95940a7c954b6b937e86844a33bd
patch
-
git.kernel.org
/stable/c/8ea8ef5e42173560ac510e92a1cc797ffeea8831
patch
-
git.kernel.org
/stable/c/dbff5f0bfb2416b8b55c105ddbcd4f885e98fada
patch
-
git.kernel.org
/stable/c/7b4881da5b19f65709f5c18c1a4d8caa2e496461
patch
-
git.kernel.org
/stable/c/66df065b3106964e667b37bf8f7e55ec69d0c1f6
patch
-
git.kernel.org
/stable/c/31310e373f4c8c74e029d4326b283e757edabc0b
patch
-
git.kernel.org
/stable/c/e60b613df8b6253def41215402f72986fee3fc8d
patch
-
lists.debian.org
/debian-lts-announce/2025/03/msg00002.html
mailing-list, third-party-advisory
Sources
- CVE List CVE-2024-38588
- NVD CVE-2024-38588
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.