Vulnerability · Published Apr 1, 2025 · Assigned by Linux
CVE-2025-21899tracing: Fix bad hist from corrupting named_triggers list
High 7.8
In plain English
A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 14% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.133-1 | DSA-5900-1 |
| Debian:12 | linux | 6.1.133-1 | DEBIAN-CVE-2025-21899 |
| Debian:13 | linux | 6.12.19-1 | DEBIAN-CVE-2025-21899 |
| Debian:14 | linux | 6.12.19-1 | DEBIAN-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux | 6.8.0-84.84 | USN-7764-1 |
| Ubuntu:24.04:LTS | linux | 6.8.0-84.84 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-aws | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1039.41 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1039.41 | USN-7764-1 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1039.41~22.04.1 | USN-7766-1 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1039.41~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-azure | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1038.44 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1038.44 | USN-7802-1 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | 6.11.0-1015.15~24.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1036.42~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1036.42~22.04.1 | USN-7802-1 |
| Ubuntu:22.04:LTS | linux-azure-fde | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1025.27 | USN-7809-1 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1025.27 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-gcp | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1040.42 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1040.42 | USN-7764-1 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | 6.11.0-1015.15~24.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1040.42~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1040.42~22.04.1 | USN-7766-1 |
| Ubuntu:22.04:LTS | linux-gke | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1036.40 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1036.40 | USN-7764-1 |
| Ubuntu:22.04:LTS | linux-gkeop | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1023.25 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1023.25 | USN-7764-1 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | 6.11.0-26.26~24.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-85.85~22.04.1 | USN-7801-1 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-84.84~22.04.1 | USN-7764-2 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-85.85~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-ibm | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1037.37 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1037.37 | USN-7779-1 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1037.37~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1037.37~22.04.1 | USN-7779-1 |
| Ubuntu:24.04:LTS | linux-intel | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-intel-iotg | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-kvm | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-lowlatency | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-84.84.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-84.84.1 | USN-7764-1 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | 6.11.0-1014.15~24.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-84.84.1~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-84.84.1~22.04.1 | USN-7764-1 |
| Ubuntu:22.04:LTS | linux-nvidia | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1039.42 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1039.42 | USN-7765-1 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | 6.11.0-1010.10 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1039.42~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1039.42~22.04.1 | USN-7765-1 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1039.42.1 | USN-7765-1 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1039.42.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1010.10 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1022.22 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-oracle | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1037.38 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1037.38 | USN-7801-2 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1037.38~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1037.38~22.04.1 | USN-7801-3 |
| Ubuntu:22.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1039.43 | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1039.43 | USN-7790-1 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-84.84~22.04.1 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2025-21899 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1018.19 | UBUNTU-CVE-2025-21899 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | no fix listed | UBUNTU-CVE-2025-21899 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 067fe038e70f6e64960d26a79c4df5f1413d0f13 – before 5ae1b18f05ee2b849dc03b6c15d7da0c1c6efa77067fe038e70f6e64960d26a79c4df5f1413d0f13 – before 43b254d46c740bf9dbe65709afa021dd726dfa99067fe038e70f6e64960d26a79c4df5f1413d0f13 – before 435d2964af815aae456db554c62963b4515f19d0067fe038e70f6e64960d26a79c4df5f1413d0f13 – before f1ae50cfb818ce1ac7a674406dfadb7653e2552d067fe038e70f6e64960d26a79c4df5f1413d0f13 – before 6f86bdeab633a56d5c6dccf1a2c5989b6a5e323e |
| Linux | Linux | 4.17 |
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
- https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html