CVE-2026-99140: tracing: Fix hist trigger timestamps for buffered events
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix hist trigger timestamps for buffered events
Syzkaller triggered a WARNONONCE(!nest) warning:
WARNING: kernel/trace/ringbuffer.c:821 at ringbuffereventtimestamp Call trace: ringbuffereventtimestamp histfieldtimestamp histfncall eventhisttrigger eventtriggerscall eventtriggertestdiscard traceeventbuffercommit dotraceeventraweventschedswitch traceeventraweventschedswitch
The warning is probabilistically reproducible and is related to syzkaller executing the following commands:
echo 'prevpid == 999999' > events/sched/schedswitch/filter echo 'hist:keys=commontimestamp' > events/sched/schedswitch/trigger
The specific triggering process is as follows:
CPU 0 CPU 1 (context switching) (echo 'hist:keys=commontimestamp' > \ events/sched/schedswitch/trigger) dotraceeventrawevent##call traceeventbufferlockreserve if (!tr->nofilterbufferingref && tracefile->flags & EVENTFILEFLFILTERED) return entry; // return directly eventhisttriggerparse histregistertrigger tracingsetfilterbuffering(file->tr, true); tr->nofilterbufferingref++; tracebufferlockreserve rbstartcommit localinc(&cpubuffer->committing); // skipped and not executed traceeventbuffercommit eventtriggertestdiscard eventtriggerscall eventhisttrigger histfncall histfieldtimestamp ringbuffereventtimestamp nest = localread(&cpubuffer->committing); WARNONONCE(!nest) // trigger warning
The root cause is that when an event file has a filter attached and the hist trigger has not yet been attached, traceeventbufferlockreserve() writes the event into the per-CPU tracebufferedevent temp buffer instead of reserving it in the ring buffer, so cpubuffer->committing is not incremented. When the event is later processed at commit time by a hist trigger, histfieldtimestamp() -> ringbuffereventtimestamp() sees a zero committing count, triggering WARNONONCE(!nest).
tracingeventtimestamp() was added by commit d8279bfc5e959 ("tracing: Add tracingeventtimestamp() API") for exactly this case: if the event is the per-CPU tracebufferedevent, it returns the current ring buffer timestamp. But it never gained a caller. Use it in histfieldtimestamp(), so that a hist trigger that races onto a buffered event records the current time, which is only marginally later than when the event was recorded, instead of warning and recording a bogus timestamp.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.224 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.191 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.161 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.115 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.59 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.2.13 - Upgrade
Upgrade
azurelinux/kernelto a version that resolves this vulnerability.Fixed in 6.6.161.1-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.192-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.115-2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.2.13-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.115-2~deb12u1 - Upgrade
Upgrade
ubuntu/linux-gcp-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1122.132~20.04.1 - Upgrade
Upgrade
ubuntu/linux-ibm-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1115.119~20.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.15.0-204.214 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.15.0-1121.128 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.15.0-1122.132 - Upgrade
Upgrade
ubuntu/linux-gcp-6.8to a version that resolves this vulnerability.Fixed in 6.8.0-1074.82~22.04.1 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 5.15.0-1117.123 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.15.0-1104.112 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.15.0-1115.119 - Upgrade
Upgrade
ubuntu/linux-ibm-6.8to a version that resolves this vulnerability.Fixed in 6.8.0-1070.71~22.04.1 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.15.0-1113.118 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.15.0-1118.124 - Upgrade
Upgrade
ubuntu/linux-oracle-6.8to a version that resolves this vulnerability.Fixed in 6.8.0-1068.72~22.04.1 - Upgrade
Upgrade
ubuntu/linux-aws-fipsto a version that resolves this vulnerability.Fixed in 5.15.0-1121.128+fips1 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 5.15.0-204.214+fips1 - Upgrade
Upgrade
ubuntu/linux-gcp-fipsto a version that resolves this vulnerability.Fixed in 5.15.0-1122.132+fips1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 6.8.0-151.151 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 6.8.0-1070.76 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 6.8.0-1074.82 - Upgrade
Upgrade
ubuntu/linux-gcp-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1018.20~24.04.1 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 6.8.0-1069.78 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 6.8.0-1054.58 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 6.8.0-1070.71 - Upgrade
Upgrade
ubuntu/linux-vmwareto a version that resolves this vulnerability.Fixed in 6.8.0-1011.11 - Upgrade
Upgrade
ubuntu/linux-aws-fipsto a version that resolves this vulnerability.Fixed in 6.8.0-1070.76+fips1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.3.0-10.10 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.3.0-1004.4 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 7.3.0-1004.4 - Upgrade
Upgrade
ubuntu/linux-azure-fdeto a version that resolves this vulnerability.Fixed in 7.3.0-1004.5 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.3.0-1004.4 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.3.0-1004.4 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 7.3.0-1004.4 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 7.3.0-10.10.1 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.3.0-10.10.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-44.44 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1018.19 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1018.20 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 7.0.0-1011.12 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1019.19 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1019.19 - Upgrade
Upgrade
ubuntu/linux-vmwareto a version that resolves this vulnerability.Fixed in 7.0.0-1007.7 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.192-1Fixed in 6.12.115-2Fixed in 7.2.13-1 - Upgrade
Upgrade
azurelinux/kernelto a version that resolves this vulnerability.Fixed in 0:6.18.62-1.1.azl4 - Compensating control
In hist_field_timestamp(), use tracing_event_time_stamp() so hist triggers racing onto buffered events record the current ring-buffer timestamp.
Event History
Frequently Asked Questions
What configuration is needed to trigger the warning?
The reported reproducer applies a filter to events/sched/sched_switch using "prev_pid == 999999" and then creates a histogram trigger keyed on common_timestamp. The issue is associated with histogram trigger timestamps when events are buffered.
What access would an attacker or tester need?
They would need the ability to modify the sched_switch event filter and trigger configuration, as shown by writes to events/sched/sched_switch/filter and events/sched/sched_switch/trigger. The provided data does not specify the required privilege level.
How can I determine whether a system is exhibiting this issue?
Look for a probabilistic WARN_ON_ONCE(!nest) warning at kernel/trace/ring_buffer.c:821 in ring_buffer_event_time_stamp. The reported call trace includes ring_buffer_event_time_stamp, hist_field_timestamp, hist_fn_call, event_hist_trigger, and trace_event_raw_event_sched_switch.
What can be done before applying the fix?
Avoid the affected combination of buffered sched_switch filtering and histogram triggers that use common_timestamp. In particular, do not create the reported hist:keys=common_timestamp trigger while the described sched_switch filter is configured.