# CVE-2024-38588: ftrace: Fix possible use-after-free issue in ftrace\_location()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.33% (percentile 19, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-06-19T13:37:43.262Z
- **Modified:** 2026-08-05T11:33:01.142Z

## Who should check

- Anyone running Linux \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< eea46baf145150910ba134f75a67106ba2222c1b; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 1880a324af1c95940a7c954b6b937e86844a33bd; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 8ea8ef5e42173560ac510e92a1cc797ffeea8831; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< dbff5f0bfb2416b8b55c105ddbcd4f885e98fada; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 7b4881da5b19f65709f5c18c1a4d8caa2e496461; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 66df065b3106964e667b37bf8f7e55ec69d0c1f6; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 31310e373f4c8c74e029d4326b283e757edabc0b; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< e60b613df8b6253def41215402f72986fee3fc8d
- Anyone running Linux 3.7

## 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().

## Affected and fixed versions

- Linux: \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< eea46baf145150910ba134f75a67106ba2222c1b; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 1880a324af1c95940a7c954b6b937e86844a33bd; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 8ea8ef5e42173560ac510e92a1cc797ffeea8831; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< dbff5f0bfb2416b8b55c105ddbcd4f885e98fada; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 7b4881da5b19f65709f5c18c1a4d8caa2e496461; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 66df065b3106964e667b37bf8f7e55ec69d0c1f6; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 31310e373f4c8c74e029d4326b283e757edabc0b; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< e60b613df8b6253def41215402f72986fee3fc8d (cvelist)
- Linux: 3.7 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-38588. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-38588.md
Affected: Linux >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < eea46baf145150910ba134f75a67106ba2222c1b; >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < 1880a324af1c95940a7c954b6b937e86844a33bd; >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < 8ea8ef5e42173560ac510e92a1cc797ffeea8831; >= ae6aa16fdc163afe6b04b6c…
Fixed in: Linux 1880a324af1c95940a7c954b6b937e86844a33bd, Linux 8ea8ef5e42173560ac510e92a1cc797ffeea8831, Linux 7b4881da5b19f65709f5c18c1a4d8caa2e496461, Linux 66df065b3106964e667b37bf8f7e55ec69d0c1f6, Linux 31310e373f4c8c74e029d4326b283e757edabc0b

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-38588 being exploited?

There is no confirmed exploitation: CVE-2024-38588 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.33% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-38588?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-38588?

Linux \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< eea46baf145150910ba134f75a67106ba2222c1b; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 1880a324af1c95940a7c954b6b937e86844a33bd; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 8ea8ef5e42173560ac510e92a1cc797ffeea8831; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< dbff5f0bfb2416b8b55c105ddbcd4f885e98fada; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 7b4881da5b19f65709f5c18c1a4d8caa2e496461; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 66df065b3106964e667b37bf8f7e55ec69d0c1f6; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< 31310e373f4c8c74e029d4326b283e757edabc0b; \>= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, \< e60b613df8b6253def41215402f72986fee3fc8d; Linux 3.7.

### Is there a fix for CVE-2024-38588?

Yes. Fixed in Linux 1880a324af1c95940a7c954b6b937e86844a33bd, Linux 8ea8ef5e42173560ac510e92a1cc797ffeea8831, Linux 7b4881da5b19f65709f5c18c1a4d8caa2e496461, Linux 66df065b3106964e667b37bf8f7e55ec69d0c1f6, Linux 31310e373f4c8c74e029d4326b283e757edabc0b. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-38588?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/eea46baf145150910ba134f75a67106ba2222c1b>
- patch: <https://git.kernel.org/stable/c/1880a324af1c95940a7c954b6b937e86844a33bd>
- patch: <https://git.kernel.org/stable/c/8ea8ef5e42173560ac510e92a1cc797ffeea8831>
- patch: <https://git.kernel.org/stable/c/dbff5f0bfb2416b8b55c105ddbcd4f885e98fada>
- patch: <https://git.kernel.org/stable/c/7b4881da5b19f65709f5c18c1a4d8caa2e496461>
- patch: <https://git.kernel.org/stable/c/66df065b3106964e667b37bf8f7e55ec69d0c1f6>
- patch: <https://git.kernel.org/stable/c/31310e373f4c8c74e029d4326b283e757edabc0b>
- patch: <https://git.kernel.org/stable/c/e60b613df8b6253def41215402f72986fee3fc8d>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-38588>

HTML: <https://flawdb.com/CVE-2024-38588> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-38588>
