CVE-2026-97922: tracing: Free histogram var refs regardless of how often they are referenced
In the Linux kernel, the following vulnerability has been resolved:
tracing: Free histogram var refs regardless of how often they are referenced
Using the same variable three or more times in one hist trigger leaks the variable reference and its strings when the trigger is removed.
commit 656fe2ba85e8 ("tracing: Use hist trigger's varref array to destroy varrefs") made a trigger's varrefs[] array the only owner of a var ref: destroyhistfield() returns early for HISTFIELDFLVARREF, so the field expressions never destroy one. One entry, freed once, no count needed.
commit 8bcebc77e85f ("tracing: Fix histogram code when expression has same var as value") then made repeated references share one object and added a count of them. Only the increment side exists, since those expressions still return early and never drop a reference, so destroyhistfield() sees how many references were created rather than how many are left. It frees when the decremented count is 0 or 1, so two references work and three or more leak.
Sharing kept one array entry per object, and createvarref() searches and appends within a single trigger, so nothing outside it holds the object. Removing a trigger whose variables are still referenced is already refused by checkvarrefs() with -EBUSY. Drop the count and free unconditionally.
Affected Software
Event History
Frequently Asked Questions
What condition triggers the leak?
A histogram trigger must use the same variable three or more times. When that trigger is removed, the shared variable reference and its associated strings are leaked.
Are repeated references in separate histogram triggers relevant?
The shared variable-reference object is tracked within a single trigger. The described issue applies to repeated use of the same variable within one histogram trigger, not references held outside that trigger.
What is the impact of removing an affected trigger?
Removing the trigger does not free the variable reference or its strings when the variable was referenced three or more times. This results in a kernel memory leak.