CVE-2025-21899: tracing: Fix bad hist from corrupting named_triggers list
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix bad hist from corrupting named_triggers list
The following commands causes a crash:
~# cd /sys/kernel/tracing/events/rcu/rcu_callback
~# echo 'hist:name=bad:keys=common_pid:onmax(bogus).save(common_pid)' > trigger
bash: echo: write error: Invalid argument
~# echo 'hist:name=bad:keys=common_pid' > trigger
Because the following occurs:
event_trigger_write() {
trigger_process_regex() {
event_hist_trigger_parse() {
data = event_trigger_alloc(..);
event_trigger_register(.., data) {
cmd_ops->reg(.., data, ..) [hist_register_trigger()] {
data->ops->init() [event_hist_trigger_init()] {
save_named_trigger(name, data) {
list_add(&data->named_list, &named_triggers);
}
}
}
}
ret = create_actions(); (return -EINVAL)
if (ret)
goto out_unreg;
[..]
ret = hist_trigger_enable(data, ...) {
list_add_tail_rcu(&data->list, &file->triggers); <<<---- SKIPPED!!! (this is important!)
[..]
out_unreg:
event_hist_unregister(.., data) {
cmd_ops->unreg(.., data, ..) [hist_unregister_trigger()] {
list_for_each_entry(iter, &file->triggers, list) {
if (!hist_trigger_match(data, iter, named_data, false)) <- never matches
continue;
[..]
test = iter;
}
if (test && test->ops->free) <<<-- test is NULL
test->ops->free(test) [event_hist_trigger_free()] {
[..]
if (data->name)
del_named_trigger(data) {
list_del(&data->named_list); <<<<-- NEVER gets removed!
}
}
}
}
[..]
kfree(data); <<<-- frees item but it is still on list
The next time a hist with name is registered, it causes an u-a-f bug and
the kernel can crash.
Move the code around such that if event_trigger_register() succeeds, the
next thing called is hist_trigger_enable() which adds it to the list.
A bunch of actions is called if get_named_trigger_data() returns false.
But that doesn't need to be called after event_trigger_register(), so it
can be moved up, allowing event_trigger_register() to be called just
before hist_trigger_enable() keeping them together and allowing the
file->triggers to be properly populated.
Security readout for executives and security teams
Plain-English summary
A malformed Linux tracing histogram request can leave a freed object referenced by kernel bookkeeping. A later named histogram registration can use that stale reference and crash the kernel. The issue is local rather than directly network reachable, and is most concerning where lower-privileged users can access tracing controls.
Executive priority
Treat this as a high-priority local kernel issue, especially on shared or exposed compute systems. It is less urgent than a remotely exploitable flaw on tightly controlled single-user hosts, but a successful crash could disrupt critical workloads. Patch through supported distribution channels and verify the running kernel after reboot.
Technical view
Failed histogram action creation occurs after registration in named_triggers but before insertion into file->triggers. Unregistration cannot find the trigger, so its allocation is freed while the named-list entry remains. A subsequent named histogram registration accesses that stale entry, causing a use-after-free and potentially a kernel crash.
Likely exposure
Exposure applies to affected Linux kernels when a local user can write tracing event trigger controls. Multi-user hosts and systems granting tracing access beyond trusted administrators deserve priority. The bundle does not provide complete distribution package mappings or unambiguous vulnerable-version boundaries, so confirm status through the relevant Linux vendor.
Exploitation context
The CVSS vector describes local, low-complexity exploitation requiring low privileges and no user interaction. The supplied sources demonstrate a use-after-free and kernel crash. CVE-2025-21899 is not listed as KEV, and the bundle provides no evidence of active exploitation or a reliable privilege-escalation technique.
Researcher notes
The confirmed primitive is a tracing-subsystem use-after-free caused by inconsistent named_triggers and file->triggers list state. The supplied description establishes a reproducible crash. Although CVSS scores confidentiality, integrity, and availability impacts as high, the sources do not establish practical code execution, privilege escalation, or exploitation in the wild. Affected-version data contains duplication and requires vendor confirmation.
Mitigation direction
Install the vendor kernel containing the applicable stable fix, then reboot into the updated kernel.
Follow distribution-specific package guidance instead of relying solely on upstream kernel version numbers.
Until patched, restrict tracing controls to trusted administrators and minimize untrusted local access.
Prioritize shared systems where lower-privileged users may have access to kernel tracing facilities.
Validation and detection
Inventory running kernel versions and distribution package releases across affected systems.
Compare each package release with its vendor advisory and the applicable upstream stable fix.
Confirm systems rebooted into the updated kernel rather than merely installing it.
Review permissions on tracing event trigger controls and investigate unexpected trigger activity.
Avoid reproducing the malformed trigger sequence on production systems because it can crash the kernel.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-21899 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
1ADP providers
7Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.