UBUNTU-CVE-2026-97935: Use After Free
In the Linux kernel, the following vulnerability has been resolved: tracing: Set the trace clock before registering the histogram trigger histregistertrigger() puts the trigger on the global namedtriggers list in cmdops->init(), and only then sets the trace clock: if (data->cmdops->init) { ret = data->cmdops->init(data); if (ret < 0) goto out; } if (histdata->enabletimestamps) { ret = tracingsetclock(file->tr, histdata->attrs->clock); if (ret) { histerr(tr, HISTERRSETCLOCKFAIL, errpos(clock)); goto out; } The clock string is not checked anywhere before that call, so a named trigger using commontimestamp with an unknown clock fails after it has already become findable. eventhisttriggerparse() then frees it without taking it off the list, and the next lookup by name reads the freed object: ~# cd /sys/kernel/tracing/events/sched/schedswitch ~# echo 'hist:name=foo:keys=commonpid:ts=commontimestamp:clock=bogus' > trigger bash: echo: write error: Invalid argument ~# echo 'hist:name=foo:keys=commonpid' > trigger BUG: KASAN: slab-use-after-free in findnamedtrigger+0xac/0xc0 Read of size 8 at addr ffff88800915d760 by task init/1 findnamedtrigger+0xac/0xc0 histregistertrigger+0xc1/0x900 eventhisttriggerparse+0x3146/0x6af0 eventtriggerwrite+0xce/0x160 Freed by task 63: kfree+0x154/0x420 triggerkthreadfn+0xfd/0x160 Set the clock before the trigger is registered, so that nothing which can fail runs after it is published, the way commit 6f86bdeab633 ("tracing: Fix bad hist from corrupting namedtriggers list") moved the registration below the rest of the setup. tracingsetfilterbuffering() is reference counted, so the init failure path has to drop the reference that the clock block now takes first.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
In Linux kernel tracing histogram trigger registration, call tracing_set_clock() before publishing the trigger on the global named_triggers list; on initialization failure, drop the reference acquired by the clock block via tracing_set_filter_buffering().
Event History
Frequently Asked Questions
What access does an attacker need to trigger this issue?
The provided reproduction writes histogram trigger definitions to the tracing event trigger interface under /sys/kernel/tracing. Exploitation therefore requires the ability to configure trace event triggers on the affected system.
What input pattern causes the use-after-free?
A named histogram trigger must use common_timestamp with an invalid clock value, causing clock setup to fail after the trigger has been added to the global named-trigger list. A later trigger definition that looks up the same name can then access the freed trigger object.
How can administrators check for an attempted trigger of this condition?
The example failed trigger write returns an Invalid argument error, and a subsequent lookup of the same trigger name can produce a KASAN slab-use-after-free report in find_named_trigger. Check tracing-trigger activity and kernel logs for these symptoms.
What can be done before an update is applied?
Restrict access to the tracing trigger interface and do not permit creation of named histogram triggers using common_timestamp with unvalidated clock values. In particular, avoid retrying or creating another named trigger with the same name after an invalid-clock trigger write fails.