CVE-2024-38588 ftrace: Fix possible use-after-free issue in ftrace_location()
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: total
- Technology
- Linux KernelUbuntuDebian
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:
- Hold rcu lock as accessing ftrace pages in ftrace_location_range();
- Use ftrace_location_range() instead of lookup_rec() in
ftrace_location(); - Call synchronize_rcu() before freeing any ftrace pages both in
ftrace_process_locs()/ftrace_release_mod()/ftrace_free_mem().
Upgrade path
11 packages: 10 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/linux(Debian 12) | < 6.1.94-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +20 more | 6.1.94-1 | Fixed |
| debian/linux(Debian 13) | < 6.8.12-1 | 6.8.12-1 | Fixed |
| debian/linux(Debian 14) | < 6.8.12-1 | 6.8.12-1 | Fixed |
| Linux kernel | < 5.4.286; < 5.10.227; < 5.15.162; < 6.1.93 +20 more | 5.4.286, 5.10.227, 5.15.162, 6.1.93, 6.6.33, 6.8.12, 6.9.3, 6.10, 7b4881da5b19f65709f5c18c1a4d8caa2e496461, 8ea8ef5e42173560ac510e92a1cc797ffeea8831, 66df065b3106964e667b37bf8f7e55ec69d0c1f6, 1880a324af1c95940a7c954b6b937e86844a33bd, 31310e373f4c8c74e029d4326b283e757edabc0b, dbff5f0bfb2416b8b55c105ddbcd4f885e98fada, e60b613df8b6253def41215402f72986fee3fc8d, eea46baf145150910ba134f75a67106ba2222c1b | Fixed |
| Microsoft cbl mariner | < 5.15.167.1-2 | 5.15.167.1-2 | Fixed |
| ubuntu/linux(Ubuntu 22.04) | < 5.15.0-121.131 | 5.15.0-121.131 | Fixed |
| ubuntu/linux(Ubuntu 24.04) | < 6.8.0-40.40 | 6.8.0-40.40 | Fixed |
| ubuntu/linux-kvm(Ubuntu 22.04) | < 5.15.0-1066.71 | 5.15.0-1066.71 | Fixed |
| ubuntu/linux-raspi(Ubuntu 22.04) | < 5.15.0-1062.65 | 5.15.0-1062.65 | Fixed |
| ubuntu/linux-raspi(Ubuntu 24.04) | < 6.8.0-1009.10 | 6.8.0-1009.10 | Fixed |
| debian linux | = 11.0 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| Microsoft cbl mariner | < 5.15.167.1-2 | 5.15.167.1-2 |
| debian/linux(Debian:12) | < 6.1.94-1 | 6.1.94-1 |
| debian/linux(Debian:12) | = 6.1.27-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.37-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.52-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.64-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.66-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.67-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.82-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.85-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1~bpo11+1 | No fix listed |
Show 32 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/linux(Debian:13) | < 6.8.12-1 | 6.8.12-1 |
| debian/linux(Debian:14) | < 6.8.12-1 | 6.8.12-1 |
| ubuntu/linux(Ubuntu:22.04) | < 5.15.0-121.131 | 5.15.0-121.131 |
| ubuntu/linux-kvm(Ubuntu:22.04) | < 5.15.0-1066.71 | 5.15.0-1066.71 |
| ubuntu/linux-raspi(Ubuntu:22.04) | < 5.15.0-1062.65 | 5.15.0-1062.65 |
| Linux kernel | >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < eea46baf145150910ba134f75a67106ba2222c1b | eea46baf145150910ba134f75a67106ba2222c1b |
| Linux kernel | >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < 1880a324af1c95940a7c954b6b937e86844a33bd | 1880a324af1c95940a7c954b6b937e86844a33bd |
| Linux kernel | >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < 8ea8ef5e42173560ac510e92a1cc797ffeea8831 | 8ea8ef5e42173560ac510e92a1cc797ffeea8831 |
| Linux kernel | >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < dbff5f0bfb2416b8b55c105ddbcd4f885e98fada | dbff5f0bfb2416b8b55c105ddbcd4f885e98fada |
| Linux kernel | >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < 7b4881da5b19f65709f5c18c1a4d8caa2e496461 | 7b4881da5b19f65709f5c18c1a4d8caa2e496461 |
| Linux kernel | >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < 66df065b3106964e667b37bf8f7e55ec69d0c1f6 | 66df065b3106964e667b37bf8f7e55ec69d0c1f6 |
| Linux kernel | >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < 31310e373f4c8c74e029d4326b283e757edabc0b | 31310e373f4c8c74e029d4326b283e757edabc0b |
| Linux kernel | >= ae6aa16fdc163afe6b04b6c073ad4ddd4663c03b, < e60b613df8b6253def41215402f72986fee3fc8d | e60b613df8b6253def41215402f72986fee3fc8d |
| Linux kernel | = 3.7 | No fix listed |
| Linux kernel | < 5.4.286 | 5.4.286 |
| Linux kernel | < 5.10.227 | 5.10.227 |
| Linux kernel | < 5.15.162 | 5.15.162 |
| Linux kernel | < 6.1.93 | 6.1.93 |
| Linux kernel | < 6.6.33 | 6.6.33 |
| Linux kernel | < 6.8.12 | 6.8.12 |
| Linux kernel | < 6.9.3 | 6.9.3 |
| Linux kernel | < 6.10 | 6.10 |
| ubuntu/linux(Ubuntu:24.04) | < 6.8.0-40.40 | 6.8.0-40.40 |
| ubuntu/linux-raspi(Ubuntu:24.04) | < 6.8.0-1009.10 | 6.8.0-1009.10 |
| debian linux | = 11.0 | No fix listed |
| Linux kernel | >= 3.7, < 5.4.286 | 5.4.286 |
| Linux kernel | >= 5.5, < 5.10.227 | 5.10.227 |
| Linux kernel | >= 5.11, < 5.15.162 | 5.15.162 |
| Linux kernel | >= 5.16, < 6.1.93 | 6.1.93 |
| Linux kernel | >= 6.2, < 6.6.33 | 6.6.33 |
| Linux kernel | >= 6.7, < 6.8.12 | 6.8.12 |
| Linux kernel | >= 6.9, < 6.9.3 | 6.9.3 |
References
- MSRC Security Update Guide vendor-advisory
- kernel vendor-advisory
- Debian Security Tracker CVE-2024-38588 vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- USN-6949-1 vendor-advisory
- USN-6952-1 vendor-advisory
- USN-6955-1 vendor-advisory
- USN-6949-2 vendor-advisory
- USN-6952-2 vendor-advisory
- USN-7007-1 vendor-advisory
- USN-7009-1 vendor-advisory
- USN-7019-1 vendor-advisory
- USN-7007-2 vendor-advisory
- USN-7007-3 vendor-advisory
- USN-7009-2 vendor-advisory
- USN-7293-1 vendor-advisory
- USN-7294-1 vendor-advisory
- USN-7295-1 vendor-advisory
- USN-7391-1 vendor-advisory
- USN-7392-1 vendor-advisory
- USN-7393-1 vendor-advisory
- USN-7392-2 vendor-advisory
- USN-7392-3 vendor-advisory
- USN-7401-1 vendor-advisory
- USN-7392-4 vendor-advisory
- USN-7413-1 vendor-advisory
- USN-7463-1 vendor-advisory
- USN-7539-1 vendor-advisory
- USN-7540-1 vendor-advisory
- www.cve.org
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- lists.debian.org mailing-list third-party-advisory
- ENISA EUVD EUVD-2024-37451 third-party-advisory