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

- Priority: **Routine**
- Reason: Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-04-01 · Modified: 2026-10-15
- Aliases: UBUNTU-CVE-2025-21899, DEBIAN-CVE-2025-21899
- Record: https://cvemate.com/vulnerability/CVE-2025-21899 · JSON: https://cvemate.com/vulnerability/CVE-2025-21899/json

## Description

```text
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.
```

## Signals

- CVSS: 7.8 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.233%, percentile 15.132%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 138)

- debian linux (Debian): \< 6.1.133-1 \| \< 6.12.19-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-84.84
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1039.41
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1039.41~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1039.41+fips1
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1038.44
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.15 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 27)

- <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>
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>
- <https://ubuntu.com/security/CVE-2025-21899>
- <https://www.cve.org/CVERecord?id=CVE-2025-21899>
- <https://git.kernel.org/linus/6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e>
- <https://ubuntu.com/security/notices/USN-7521-1>
- <https://ubuntu.com/security/notices/USN-7521-2>
- <https://ubuntu.com/security/notices/USN-7521-3>
- <https://ubuntu.com/security/notices/USN-7764-1>
- <https://ubuntu.com/security/notices/USN-7765-1>
- <https://ubuntu.com/security/notices/USN-7766-1>
- <https://ubuntu.com/security/notices/USN-7767-1>
- <https://ubuntu.com/security/notices/USN-7779-1>
- <https://ubuntu.com/security/notices/USN-7767-2>
- <https://ubuntu.com/security/notices/USN-7764-2>
- <https://ubuntu.com/security/notices/USN-7790-1>

---

Data as of 2026-12-05T04:23:16.360Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
