CVE-2025-38346

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]=OOT_MODULE, [E]=UNSIGNED_MODULE Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS RIP: 0010:sized_strscpy+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> ftrace_mod_get_kallsym+0x1ac/0x590 update_iter_mod+0x239/0x5b0 s_next+0x5b/0xa0 seq_read_iter+0x8c9/0x1070 seq_read+0x249/0x3b0 proc_reg_read+0x1b0/0x280 vfs_read+0x17f/0x920 ksys_read+0xf3/0x1c0 do_syscall_64+0x5f/0x2e0 entry_SYSCALL_64_after_hwframe+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; ftrace_mod_get_kallsym() ... strscpy(module_name, mod_map->mod->name, MODULE_NAME_LEN); ... The problem is when a module triggers an issue with ftrace and sets ftrace_disable. The ftrace_disable 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 ftrace_disable 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, ftrace_release_mod() is called, and if ftrace_disable is set, it just returns without doing anything more. The problem here is that it leaves the mod_list 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(module_name, mod_map->mod->name, MODULE_NAME_LEN); Where the "mod" no longer exists and triggers a UAF bug.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

Configuration 2 (hide)

cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*

History

16 Dec 2025, 17:38

Type Values Removed Values Added
CPE cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
References () https://git.kernel.org/stable/c/03a162933c4a03b9f1a84f7d8482903c7e1e11bb - () https://git.kernel.org/stable/c/03a162933c4a03b9f1a84f7d8482903c7e1e11bb - Patch
References () https://git.kernel.org/stable/c/6805582abb720681dd1c87ff677f155dcf4e86c9 - () https://git.kernel.org/stable/c/6805582abb720681dd1c87ff677f155dcf4e86c9 - Patch
References () https://git.kernel.org/stable/c/83a692a9792aa86249d68a8ac0b9d55ecdd255fa - () https://git.kernel.org/stable/c/83a692a9792aa86249d68a8ac0b9d55ecdd255fa - Patch
References () https://git.kernel.org/stable/c/8690cd3258455bbae64f809e1d3ee0f043661c71 - () https://git.kernel.org/stable/c/8690cd3258455bbae64f809e1d3ee0f043661c71 - Patch
References () https://git.kernel.org/stable/c/8e89c17dc8970c5f71a3a991f5724d4c8de42d8c - () https://git.kernel.org/stable/c/8e89c17dc8970c5f71a3a991f5724d4c8de42d8c - Patch
References () https://git.kernel.org/stable/c/d064c68781c19f378af1ae741d9132d35d24b2bb - () https://git.kernel.org/stable/c/d064c68781c19f378af1ae741d9132d35d24b2bb - Patch
References () https://git.kernel.org/stable/c/f78a786ad9a5443a29eef4dae60cde85b7375129 - () https://git.kernel.org/stable/c/f78a786ad9a5443a29eef4dae60cde85b7375129 - Patch
References () https://git.kernel.org/stable/c/f914b52c379c12288b7623bb814d0508dbe7481d - () https://git.kernel.org/stable/c/f914b52c379c12288b7623bb814d0508dbe7481d - Patch
References () https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html - () https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html - Third Party Advisory
References () https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html - () https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html - Third Party Advisory
CWE CWE-416
First Time Linux
Debian
Debian debian Linux
Linux linux Kernel
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 7.8

03 Nov 2025, 18:16

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ftrace: Reparar UAF cuando se busca kallsym después de ftrace deshabilitado El siguiente problema ocurre con un módulo con errores: ERROR: no se puede controlar el error de página para la dirección: ffffffffc05d0218 PGD 1bd66f067 P4D 1bd66f067 PUD 1bd671067 PMD 101808067 PTE 0 Oops: Oops: 0000 [#1] SMP KASAN PTI Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE Nombre del hardware: QEMU Standard PC (i440FX + PIIX, 1996), BIOS RIP: 0010:sized_strscpy+0x81/0x2f0 RSP: 0018:ffff88812d76fa08 EFLAGS: 00010246 RAX: 0000000000000000 RBX: fffffffc0601010 RCX: dffffc0000000000 RDX: 0000000000000038 RSI: dffffc0000000000 RDI: ffff88812608da2d RBP: 8080808080808080 R08: ffff88812608da2d R09: ffff88812608da68 R10: ffff88812608d82d R11: ffff88812608d810 R12: 000000000000038 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: 00000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Rastreo de llamadas: ftrace_mod_get_kallsym+0x1ac/0x590 update_iter_mod+0x239/0x5b0 s_next+0x5b/0xa0 seq_read_iter+0x8c9/0x1070 seq_read+0x249/0x3b0 proc_reg_read+0x1b0/0x280 vfs_read+0x17f/0x920 ksys_read+0xf3/0x1c0 do_syscall_64+0x5f/0x2e0 entry_SYSCALL_64_after_hwframe+0x76/0x7e El problema anterior puede ocurrir de la siguiente manera: (1) Agregar punto de seguimiento de kprobe; (2) insmod test.ko; (3) El módulo activa ftrace deshabilitado; (4) rmmod test.ko; (5) cat /proc/kallsyms; --&gt; Activará UAF como test.ko ya eliminado; ftrace_mod_get_kallsym() ... strscpy(module_name, mod_map-&gt;mod-&gt;name, MODULE_NAME_LEN); ... El problema es cuando un módulo activa un problema con ftrace y establece ftrace_disable. ftrace_disable se establece cuando se descubre una anomalía y para evitar más daños, ftrace detiene toda modificación de texto. El problema que ocurrió fue que ftrace_disable detiene más que solo la modificación de texto. Cuando se carga un módulo, también se pueden rastrear sus funciones de inicio. Dado que kallsyms elimina las funciones de inicio después de cargar un módulo, ftrace las guarda cuando el módulo se carga y se habilita el seguimiento de funciones. Esto permite que la salida del seguimiento de funciones muestre los nombres de las funciones de inicio en lugar de solo sus direcciones de memoria. Al eliminar un módulo, se llama a ftrace_release_mod() y, si ftrace_disable está configurado, simplemente regresa sin hacer nada más. El problema es que deja la lista de mods (mod_list) aún activa, y si se llama a kallsyms, este ejecutará este código y accederá a la memoria del módulo ya liberada, ya que devolverá: strscpy(module_name, mod_map-&gt;mod-&gt;name, MODULE_NAME_LEN); Donde el "mod" ya no existe, lo que genera un error de UAF.
References
  • () https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html -
  • () https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html -

10 Jul 2025, 09:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-07-10 09:15

Updated : 2025-12-16 17:38


NVD link : CVE-2025-38346

Mitre link : CVE-2025-38346

CVE.ORG link : CVE-2025-38346


JSON object : View

Products Affected

debian

  • debian_linux

linux

  • linux_kernel
CWE
CWE-416

Use After Free