Skip to main content
Vulnerability Database/CVE-2026-97936

CVE-2026-97936: Linux Kernel Buffer Overflow Vulnerability

CVE-2026-97936 is a buffer overflow flaw in the Linux kernel tracing subsystem that causes memory corruption through improper histogram stacktrace handling. This post covers technical details, affected versions, impact, and mitigation steps.

Published:

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-97936 Overview

CVE-2026-97936 is a memory corruption vulnerability in the Linux kernel's tracing subsystem. The flaw resides in the histogram stacktrace modifier handling within parse_field() and create_hist_field(). The code sets the HIST_FIELD_FL_STACKTRACE flag from the .stacktrace modifier before resolving the field name, and no subsequent check verifies that the resolved field actually holds a stacktrace. A local user with access to /sys/kernel/tracing can trigger an unbounded memcpy() in event_hist_trigger(), corrupting kernel memory and causing a crash or potential privilege escalation.

Critical Impact

An unprivileged write to a tracing trigger file can cause out-of-bounds kernel memory writes, leading to kernel panic and potential local privilege escalation.

Affected Products

  • Linux Kernel (tracing/histogram subsystem)
  • Distributions shipping unpatched upstream kernels prior to the referenced stable commits
  • Systems exposing /sys/kernel/tracing to privileged users or containers

Discovery Timeline

  • 2026-09-25 - CVE-2026-97936 published to the National Vulnerability Database (NVD)
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-97936

Vulnerability Analysis

The vulnerability lives in the kernel's event histogram trigger logic under kernel/trace/trace_events_hist.c. When a user writes a histogram trigger such as hist:keys=parent_pid.stacktrace, parse_field() records the .stacktrace modifier flag before validating the referenced field. create_hist_field() then selects the HIST_FIELD_FN_STACK handler based only on the presence of a field pointer. At trigger time, event_hist_trigger() interprets the referenced field as a __data_loc reference and treats the first word at the offset as an entry count.

The handler then executes:

n_entries = *stack; memcpy(entries, ++stack, n_entries * sizeof(unsigned long));

Neither the source bounds nor the destination buffer (a fixed 31-entry array) are validated. Because n_entries is attacker-controlled event data, the copy can run far past the destination, corrupting adjacent kernel structures. KASAN reports the write as an out-of-bounds read of 13,835,058,055,416,381,440 bytes, and the reproducer triggers a NULL pointer dereference in rb_insert_color when a timer interrupt hits the corrupted rbtree.

Root Cause

The root cause is missing type validation on fields referenced by the .stacktrace modifier. Documentation already specifies the referenced field "must be a long[] type", but the parser never enforced this. Pseudo-fields such as hitcount.stacktrace and the common_* fields hold no stacktrace data yet were accepted. This is an out-of-bounds write (CWE-787) caused by improper input validation.

Attack Vector

Exploitation requires local access with write permission to the tracing filesystem, typically CAP_SYS_ADMIN or membership in a group granted access to /sys/kernel/tracing. An attacker writes a crafted histogram trigger that pairs the .stacktrace modifier with any non-stacktrace field (for example, parent_pid). When the associated tracepoint fires, the kernel executes the unbounded memcpy() using attacker-influenced data, corrupting kernel memory. The vulnerability is reachable in containerized or multi-tenant environments where tracing has been exposed to lower-privileged workloads.

Detection Methods for CVE-2026-97936

Indicators of Compromise

  • Kernel oops or panic logs referencing event_hist_trigger+0x165/0x690 or memcpy+0xc/0x30 on the call stack
  • KASAN reports of out-of-bounds reads with implausibly large byte counts originating in the histogram trigger path
  • Unexpected NULL pointer dereferences in rb_insert_color, timerqueue_linked_add, or enqueue_hrtimer following tracing activity

Detection Strategies

  • Audit writes to /sys/kernel/tracing/events/*/trigger and look for hist: expressions pairing non-array fields with the .stacktrace modifier
  • Enable KASAN in test and staging kernels to surface the out-of-bounds write during regression testing
  • Monitor kernel ring buffer and /var/log/kern.log for repeated histogram-related oopses that may indicate exploitation attempts

Monitoring Recommendations

  • Collect auditd events for openat and write syscalls targeting tracefs trigger files, correlated with the invoking UID
  • Alert on unexpected processes gaining write access to tracefs or debugfs mount points
  • Track kernel version inventory and flag hosts still running pre-patch builds referenced in the upstream fix commits

How to Mitigate CVE-2026-97936

Immediate Actions Required

  • Apply the upstream patches referenced in the stable kernel commits as soon as distribution packages are available
  • Restrict access to /sys/kernel/tracing and /sys/kernel/debug/tracing to root-only using filesystem permissions or mount options
  • Remove tracefs and debugfs bind mounts from unprivileged containers until the fix is deployed

Patch Information

The fix enforces that any field referenced with the .stacktrace modifier resolves to a long[] field, and refuses pseudo-fields such as hitcount.stacktrace and common_*. The upstream fix is distributed across stable branches in commits 55caaf2, 57bfc2a, a5e70ba, and e183b84. Rebuild or update kernels to a version containing one of these commits and reboot affected hosts.

Workarounds

  • Unmount or remount tracefs with mode=0700,uid=0,gid=0 so only root can create histogram triggers
  • Drop CAP_SYS_ADMIN from workloads that do not require kernel tracing
  • Disable the histogram trigger facility in build configurations by unsetting CONFIG_HIST_TRIGGERS where tracing histograms are not required
bash
# Restrict tracefs access to root until the kernel is patched
mount -o remount,mode=0700,uid=0,gid=0 /sys/kernel/tracing
chmod 700 /sys/kernel/debug/tracing 2>/dev/null || true

# Verify the running kernel contains the fix commit
uname -r
grep -r 'HIST_FIELD_FL_STACKTRACE' /lib/modules/$(uname -r)/build/kernel/trace/ 2>/dev/null

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.