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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-04-01T15:26:50.791Z
- **Modified:** 2026-10-15T22:18:11.573Z

## Who should check

- Anyone running Linux \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 43b254d46c740bf9dbe65709afa021dd726dfa99; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 435d2964af815aae456db554c62963b4515f19d0; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< f1ae50cfb818ce1ac7a674406dfadb7653e2552d; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e
- Anyone running Linux 4.17

## 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.

## Affected and fixed versions

- Linux: \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 43b254d46c740bf9dbe65709afa021dd726dfa99; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 435d2964af815aae456db554c62963b4515f19d0; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< f1ae50cfb818ce1ac7a674406dfadb7653e2552d; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e (cvelist)
- Linux: 4.17 (cvelist)

## Mitigation

- Upgrade Linux to 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-21899. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21899.md
Affected: Linux >= 067fe038e70f6e64960d26a79c4df5f1413d0f13, < 5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77; >= 067fe038e70f6e64960d26a79c4df5f1413d0f13, < 43b254d46c740bf9dbe65709afa021dd726dfa99; >= 067fe038e70f6e64960d26a79c4df5f1413d0f13, < 435d2964af815aae456db554c62963b4515f19d0; >= 067fe038e70f6e64960d26a…
Fixed in: Linux 5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77, Linux 43b254d46c740bf9dbe65709afa021dd726dfa99, Linux 435d2964af815aae456db554c62963b4515f19d0, Linux 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-21899 being exploited?

There is no confirmed exploitation: CVE-2025-21899 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-21899?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-21899?

Linux \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 43b254d46c740bf9dbe65709afa021dd726dfa99; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 435d2964af815aae456db554c62963b4515f19d0; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< f1ae50cfb818ce1ac7a674406dfadb7653e2552d; \>= 067fe038e70f6e64960d26a79c4df5f1413d0f13, \< 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e; Linux 4.17.

### Is there a fix for CVE-2025-21899?

Yes. Fixed in Linux 5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77, Linux 43b254d46c740bf9dbe65709afa021dd726dfa99, Linux 435d2964af815aae456db554c62963b4515f19d0, Linux 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e. Upgrade Linux to 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e or later.

### How do I check if I'm affected by CVE-2025-21899?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77>
- patch: <https://git.kernel.org/stable/c/43b254d46c740bf9dbe65709afa021dd726dfa99>
- patch: <https://git.kernel.org/stable/c/435d2964af815aae456db554c62963b4515f19d0>
- patch: <https://git.kernel.org/stable/c/f1ae50cfb818ce1ac7a674406dfadb7653e2552d>
- patch: <https://git.kernel.org/stable/c/6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-21899>

HTML: <https://flawdb.com/CVE-2025-21899> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-21899>
