Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-97935 Overview
CVE-2026-97935 is a use-after-free vulnerability in the Linux kernel tracing subsystem. The flaw resides in hist_register_trigger(), which registers a named histogram trigger on the global named_triggers list before validating the trace clock. When a user supplies an unknown clock string with common_timestamp, the trigger fails after already becoming findable. A subsequent lookup by name reads freed memory, as reproduced via KASAN against find_named_trigger+0xac/0xc0.
Critical Impact
Local users with write access to /sys/kernel/tracing trigger files can cause a kernel use-after-free, leading to memory corruption, information disclosure, or denial of service.
Affected Products
- Linux kernel tracing subsystem (kernel/trace/trace_events_hist.c)
- Mainline and stable branches prior to the fix commits
- Distributions shipping affected stable kernels
Discovery Timeline
- 2026-09-25 - CVE-2026-97935 published to the National Vulnerability Database (NVD)
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-97935
Vulnerability Analysis
The Linux kernel exposes histogram triggers through tracefs, allowing users to attach named counters and aggregations to trace events. The registration path in hist_register_trigger() calls data->cmd_ops->init(data), which places the trigger on the global named_triggers list. Only after that does the code invoke tracing_set_clock() when enable_timestamps is set.
If the user-supplied clock string is invalid, tracing_set_clock() fails and returns -EINVAL. However, the trigger has already been published to the global list. event_hist_trigger_parse() then calls kfree() on the trigger without removing it from named_triggers. Any subsequent find_named_trigger() call reads the freed object, as the KASAN report demonstrates.
The commit resolves the issue by setting the trace clock before registering the trigger, mirroring the pattern introduced by commit 6f86bdeab633 ("tracing: Fix bad hist from corrupting named_triggers list"). The fix also drops the reference taken by tracing_set_filter_buffering() on the init failure path.
Root Cause
The root cause is an ordering flaw: a resource becomes globally reachable before all fallible initialization steps complete. The clock string is never validated prior to list insertion, so any failure after cmd_ops->init() leaves a dangling, soon-to-be-freed pointer on named_triggers [CWE-416].
Attack Vector
Exploitation requires local access and permission to write to /sys/kernel/tracing/events/*/trigger. An attacker writes a hist trigger that references common_timestamp with an unknown clock name, then writes a second trigger with the same name. The second write triggers find_named_trigger() to dereference the freed object. The published reproducer uses two short echo commands against the sched_switch event trigger file to reach the use-after-free.
The vulnerability manifests in the trigger registration ordering logic. See the upstream commits for full technical details: Kernel Git Commit Fix, Kernel Git Commit Update, and Kernel Git Commit Change.
Detection Methods for CVE-2026-97935
Indicators of Compromise
- KASAN reports containing slab-use-after-free in find_named_trigger in dmesg or kernel logs.
- Kernel oops or panic traces referencing hist_register_trigger and event_hist_trigger_parse in sequence.
- Writes to /sys/kernel/tracing/events/*/trigger containing hist:name= with clock= set to an unknown value.
Detection Strategies
- Audit tracefs writes using auditd rules on /sys/kernel/tracing/events/ and /sys/kernel/debug/tracing/events/ paths.
- Alert on repeated failed writes to trigger files returning EINVAL followed by a second write reusing the same name= token.
- Correlate KASAN or SLUB debug messages with the originating process and user context.
Monitoring Recommendations
- Forward kernel ring buffer events to a centralized log store and alert on KASAN, BUG:, and use-after-free keywords.
- Monitor non-root processes that acquire CAP_SYS_ADMIN or write access to tracefs, which should be rare on production hosts.
- Track process execution patterns targeting /sys/kernel/tracing from shells or scripts outside expected maintenance windows.
How to Mitigate CVE-2026-97935
Immediate Actions Required
- Apply the upstream kernel patches referenced in the stable git commits as soon as vendor builds are available.
- Restrict access to /sys/kernel/tracing and /sys/kernel/debug/tracing to root and trusted administrators only.
- Remove or disable histogram trigger usage on hosts where tracing is not operationally required.
Patch Information
The fix reorders hist_register_trigger() so tracing_set_clock() runs before the trigger is placed on the named_triggers list, and it drops the tracing_set_filter_buffering() reference on the init failure path. Fixes are available in the following commits: 6ede78d0563a2a3ae3e46f9c07cedb5d79645429, 65d1e28198f344832a8a63e8ccf84b8f65b92a32, and cfad128171f8e2237a3c723d6478ef2cfb3b9127. Rebuild and reboot affected kernels after applying the patch.
Workarounds
- Mount tracefs with restrictive permissions or unmount it entirely on systems that do not require live tracing.
- Use Linux Security Modules such as SELinux or AppArmor to deny write access to tracefs trigger files for non-administrative users.
- Disable CONFIG_HIST_TRIGGERS in custom kernel builds where histogram triggers are not needed.
# Restrict tracefs access to root only
chmod 700 /sys/kernel/tracing
mount -o remount,mode=700 /sys/kernel/tracing
# Verify kernel version after patching
uname -r
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

