CVE-2026-99234: tracing: Unregister field variable histograms when the command fails
In the Linux kernel, the following vulnerability has been resolved:
tracing: Unregister field variable histograms when the command fails
An action that names a field on another event needs that field as a variable, so createfieldvarhist() registers a second hist trigger on that event to provide it, and records it in targethistdata->fieldvarhists[].
If a later part of the same command fails, createactions() returns an error and eventhisttriggerparse() jumps to outfree. The write fails with -EINVAL and schedswitch gets no trigger, but:
# echo 'hist:keys=pid:ts0=commontimestamp.usecs' >> \ events/sched/schedwaking/trigger # echo 'mysynth u64 lat; int a; int b' >> syntheticevents # echo 'hist:keys=nextpid:wakeuplat=commontimestamp.usecs-$ts0:\ onmatch(sched.schedwaking).mysynth($wakeuplat,prio,nosuchfld)'\ >> events/sched/schedswitch/trigger # cat events/sched/schedwaking/trigger hist:keys=pid:vals=hitcount:ts0=commontimestamp.usecs:sort=hitcount:size=2048:clock=global [active] hist:keys=pid:vals=hitcount:syntheticprio=prio:sort=hitcount:size=2048 [active]
The second histogram is the one created for 'prio'. It is still active and still counting.
outfree reaches destroyfieldvarhists(), which frees the fieldvarhists[] entries, but never unregisterfieldvarhists(), which is what removes the triggers and runs only from eventhisttriggerfree(). The entry is freed and the trigger is left with nothing tracking it.
Unregister the field variable histograms in outfree as well, and record each one as soon as its trigger is registered rather than after the lookup that follows it, so no exit can leave a registered trigger untracked. The entry then belongs to fieldvarhists[] and is released by destroyfieldvarhists(), so freeing it on that exit would be a double free.
Affected Software
Event History
Frequently Asked Questions
What access is needed to trigger the issue?
An attacker needs the ability to write histogram trigger commands to the kernel tracing event trigger interface. The failing command uses an onmatch action that references a field from another event and includes a later invalid field, causing the overall command to fail.
What is the observable effect after a failed trigger command?
The write returns -EINVAL and no trigger is installed on the event receiving the command. However, a helper histogram created to expose the referenced field can remain active on the other event and continue counting.
How can an administrator check for the leftover histogram in the demonstrated scenario?
Inspect the trigger file for the referenced event, such as events/sched/sched_waking/trigger. In the example, an additional active histogram containing synthetic_prio=prio indicates that the helper histogram remained registered after the failed command.