CVE-2025-39683: tracing: Limit access to parser->buffer when trace_get_user failed
In the Linux kernel, the following vulnerability has been resolved:
tracing: Limit access to parser->buffer when tracegetuser failed
When the length of the string written to setftracefilter exceeds FTRACEBUFFMAX, the following KASAN alarm will be triggered:
BUG: KASAN: slab-out-of-bounds in strsep+0x18c/0x1b0 Read of size 1 at addr ffff0000d00bd5ba by task ash/165
CPU: 1 UID: 0 PID: 165 Comm: ash Not tainted 6.16.0-g6bcdbd62bd56-dirty Hardware name: linux,dummy-virt (DT) Call trace: showstack+0x34/0x50 (C) dumpstacklvl+0xa0/0x158 printaddressdescription.constprop.0+0x88/0x398 printreport+0xb0/0x280 kasanreport+0xa4/0xf0 asanreportload1noabort+0x20/0x30 strsep+0x18c/0x1b0 ftraceprocessregex.isra.0+0x100/0x2d8 ftraceregexrelease+0x484/0x618 fput+0x364/0xa58 fput+0x28/0x40 taskworkrun+0x154/0x278 donotifyresume+0x1f0/0x220 el0svc+0xec/0xf0 el0t64synchandler+0xa0/0xe8 el0t64sync+0x1ac/0x1b0
The reason is that tracegetuser will fail when processing a string longer than FTRACEBUFFMAX, but not set the end of parser->buffer to 0. Then an OOB access will be triggered in ftraceregexrelease-> ftraceprocessregex->strsep->strpbrk. We can solve this problem by limiting access to parser->buffer when tracegetuser failed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Apply the described fix: when trace_get_user fails while processing a string, ensure ftrace_regex_release/ftrace_process_regex limits access to parser->buffer and that the buffer end is correctly handled (i.e., avoid OOB by not reading past parser->buffer when the string length exceeds FTRACE_BUFF_MAX).
Linux kernel ftrace Limit access to parser->buffer when trace_get_user failed = enabled
Event History
Frequently Asked Questions
What is the severity of CVE-2025-39683?
CVE-2025-39683 is classified as a medium severity vulnerability due to its potential impact on the Linux kernel's stability.
How do I fix CVE-2025-39683?
To fix CVE-2025-39683, update your Linux kernel to a version that includes the patch for this vulnerability.
What does CVE-2025-39683 affect?
CVE-2025-39683 affects the Linux kernel, specifically the tracing subsystem related to ftrace filtering.
Can CVE-2025-39683 lead to system crashes?
Yes, CVE-2025-39683 can potentially lead to system crashes if the KASAN alarm is triggered due to excess string length.
How can I determine if my system is vulnerable to CVE-2025-39683?
You can determine if your system is vulnerable to CVE-2025-39683 by checking the kernel version and consulting security advisories for the necessary patches.