CVE-2025-38346: ftrace: Fix UAF when lookup kallsym after ftrace disabled

Published Jul 10, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

ftrace: Fix UAF when lookup kallsym after ftrace disabled

The following issue happens with a buggy module:

BUG: unable to handle page fault for address: ffffffffc05d0218 PGD 1bd66f067 P4D 1bd66f067 PUD 1bd671067 PMD 101808067 PTE 0 Oops: Oops: 0000 [#1] SMP KASAN PTI Tainted: [O]=OOTMODULE, [E]=UNSIGNEDMODULE Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS RIP: 0010:sizedstrscpy+0x81/0x2f0 RSP: 0018:ffff88812d76fa08 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffffffffc0601010 RCX: dffffc0000000000 RDX: 0000000000000038 RSI: dffffc0000000000 RDI: ffff88812608da2d RBP: 8080808080808080 R08: ffff88812608da2d R09: ffff88812608da68 R10: ffff88812608d82d R11: ffff88812608d810 R12: 0000000000000038 R13: ffff88812608da2d R14: ffffffffc05d0218 R15: fefefefefefefeff FS: 00007fef552de740(0000) GS:ffff8884251c7000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffc05d0218 CR3: 00000001146f0000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> ftracemodgetkallsym+0x1ac/0x590 updateitermod+0x239/0x5b0 snext+0x5b/0xa0 seqreaditer+0x8c9/0x1070 seqread+0x249/0x3b0 procregread+0x1b0/0x280 vfsread+0x17f/0x920 ksysread+0xf3/0x1c0 dosyscall64+0x5f/0x2e0 entrySYSCALL64afterhwframe+0x76/0x7e

The above issue may happen as follows: (1) Add kprobe tracepoint; (2) insmod test.ko; (3) Module triggers ftrace disabled; (4) rmmod test.ko; (5) cat /proc/kallsyms; --> Will trigger UAF as test.ko already removed; ftracemodgetkallsym() ... strscpy(modulename, modmap->mod->name, MODULENAMELEN); ...

The problem is when a module triggers an issue with ftrace and sets ftracedisable. The ftracedisable is set when an anomaly is discovered and to prevent any more damage, ftrace stops all text modification. The issue that happened was that the ftracedisable stops more than just the text modification.

When a module is loaded, its init functions can also be traced. Because kallsyms deletes the init functions after a module has loaded, ftrace saves them when the module is loaded and function tracing is enabled. This allows the output of the function trace to show the init function names instead of just their raw memory addresses.

When a module is removed, ftracereleasemod() is called, and if ftracedisable is set, it just returns without doing anything more. The problem here is that it leaves the modlist still around and if kallsyms is called, it will call into this code and access the module memory that has already been freed as it will return:

strscpy(modulename, modmap->mod->name, MODULENAMELEN);

Where the "mod" no longer exists and triggers a UAF bug.

Affected Software

10 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=4.15<5.4.295
Linux Linux kernel>=5.5<5.10.239
Linux Linux kernel>=5.11<5.15.186
Linux Linux kernel>=5.16<6.1.142
Linux Linux kernel>=6.2<6.6.95
Linux Linux kernel>=6.7<6.12.35
Linux Linux kernel>=6.13<6.15.4
Debian Debian Linux=11.0
debian/linux
6.1.176-16.1.190-16.12.107-16.12.113-17.2.12-17.2.13-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1

Event History

Jul 10, 2025
CVE Published
via MITRE·08:15 AM
Data Sourced
via MITRE·08:15 AM
DescriptionSeverity
Data Sourced
via Red Hat·09:01 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·09:15 AM
RemedyDescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-38346?

CVE-2025-38346 has a medium severity rating due to its potential impact on system stability.

2

How do I fix CVE-2025-38346?

To fix CVE-2025-38346, update the Linux kernel to the latest version that addresses this vulnerability.

3

What systems are affected by CVE-2025-38346?

CVE-2025-38346 affects various versions of the Linux kernel.

4

What is the nature of the vulnerability in CVE-2025-38346?

CVE-2025-38346 is a use-after-free (UAF) vulnerability that occurs when looking up kernel symbols after ftrace has been disabled.

5

Can CVE-2025-38346 be exploited remotely?

CVE-2025-38346 is primarily a local vulnerability and is not directly exploitable over a network.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203