{"id":65938,"date":"2025-07-10T14:32:13","date_gmt":"2025-07-10T11:02:13","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2025-38346-linux-kernel-ftrace-uaf-vulnerability\/"},"modified":"2025-07-10T14:32:13","modified_gmt":"2025-07-10T11:02:13","slug":"cve-2025-38346-linux-kernel-ftrace-uaf-vulnerability","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2025-38346-linux-kernel-ftrace-uaf-vulnerability\/","title":{"rendered":"CVE-2025-38346 &#8211; Linux Kernel Ftrace UAF Vulnerability"},"content":{"rendered":"<p><strong>CVE ID : <\/strong>CVE-2025-38346<br \/>\n<br \/>\n<strong>Published : <\/strong> July 10, 2025, 9:15 a.m. | 53\u00a0minutes ago<br \/>\n<br \/>\n<strong>Description : <\/strong>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>ftrace: Fix UAF when lookup kallsym after ftrace disabled<\/p>\n<p>The following issue happens with a buggy module:<\/p>\n<p>BUG: unable to handle page fault for address: ffffffffc05d0218<br \/>\nPGD 1bd66f067 P4D 1bd66f067 PUD 1bd671067 PMD 101808067 PTE 0<br \/>\nOops: Oops: 0000 [#1] SMP KASAN PTI<br \/>\nTainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE<br \/>\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS<br \/>\nRIP: 0010:sized_strscpy+0x81\/0x2f0<br \/>\nRSP: 0018:ffff88812d76fa08 EFLAGS: 00010246<br \/>\nRAX: 0000000000000000 RBX: ffffffffc0601010 RCX: dffffc0000000000<br \/>\nRDX: 0000000000000038 RSI: dffffc0000000000 RDI: ffff88812608da2d<br \/>\nRBP: 8080808080808080 R08: ffff88812608da2d R09: ffff88812608da68<br \/>\nR10: ffff88812608d82d R11: ffff88812608d810 R12: 0000000000000038<br \/>\nR13: ffff88812608da2d R14: ffffffffc05d0218 R15: fefefefefefefeff<br \/>\nFS:  00007fef552de740(0000) GS:ffff8884251c7000(0000) knlGS:0000000000000000<br \/>\nCS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br \/>\nCR2: ffffffffc05d0218 CR3: 00000001146f0000 CR4: 00000000000006f0<br \/>\nDR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000<br \/>\nDR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400<br \/>\nCall Trace:<\/p>\n<p> ftrace_mod_get_kallsym+0x1ac\/0x590<br \/>\n update_iter_mod+0x239\/0x5b0<br \/>\n s_next+0x5b\/0xa0<br \/>\n seq_read_iter+0x8c9\/0x1070<br \/>\n seq_read+0x249\/0x3b0<br \/>\n proc_reg_read+0x1b0\/0x280<br \/>\n vfs_read+0x17f\/0x920<br \/>\n ksys_read+0xf3\/0x1c0<br \/>\n do_syscall_64+0x5f\/0x2e0<br \/>\n entry_SYSCALL_64_after_hwframe+0x76\/0x7e<\/p>\n<p>The above issue may happen as follows:<br \/>\n(1) Add kprobe tracepoint;<br \/>\n(2) insmod test.ko;<br \/>\n(3)  Module triggers ftrace disabled;<br \/>\n(4) rmmod test.ko;<br \/>\n(5) cat \/proc\/kallsyms; &#8211;&gt; Will trigger UAF as test.ko already removed;<br \/>\nftrace_mod_get_kallsym()<br \/>\n&#8230;<br \/>\nstrscpy(module_name, mod_map-&gt;mod-&gt;name, MODULE_NAME_LEN);<br \/>\n&#8230;<\/p>\n<p>The problem is when a module triggers an issue with ftrace and<br \/>\nsets ftrace_disable. The ftrace_disable is set when an anomaly is<br \/>\ndiscovered and to prevent any more damage, ftrace stops all text<br \/>\nmodification. The issue that happened was that the ftrace_disable stops<br \/>\nmore than just the text modification.<\/p>\n<p>When a module is loaded, its init functions can also be traced. Because<br \/>\nkallsyms deletes the init functions after a module has loaded, ftrace<br \/>\nsaves them when the module is loaded and function tracing is enabled. This<br \/>\nallows the output of the function trace to show the init function names<br \/>\ninstead of just their raw memory addresses.<\/p>\n<p>When a module is removed, ftrace_release_mod() is called, and if<br \/>\nftrace_disable is set, it just returns without doing anything more. The<br \/>\nproblem here is that it leaves the mod_list still around and if kallsyms<br \/>\nis called, it will call into this code and access the module memory that<br \/>\nhas already been freed as it will return:<\/p>\n<p>  strscpy(module_name, mod_map-&gt;mod-&gt;name, MODULE_NAME_LEN);<\/p>\n<p>Where the &#8220;mod&#8221; no longer exists and triggers a UAF bug.<br \/>\n<br \/>\n<strong>Severity:<\/strong> 0.0 | NA<br \/>\n<br \/>\nVisit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID : CVE-2025-38346 Published : July 10, 2025, 9:15 a.m. | 53\u00a0minutes ago Description : 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 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-65938","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/65938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=65938"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/65938\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=65938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=65938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=65938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}