Vulnerability · Published Apr 1, 2025 · Assigned by Linux
CVE-2025-21895perf/core: Order the PMU list to fix warning about unordered pmu_ctx_list
Medium 4.7
In plain English
A medium-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.1% (higher than 4% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: perf/core: Order the PMU list to fix warning about unordered pmu_ctx_list Syskaller triggers a warning due to prev_epc->pmu != next_epc->pmu in perf_event_swap_task_ctx_data(). vmcore shows that two lists have the same perf_event_pmu_context, but not in the same order. The problem is that the order of pmu_ctx_list for the parent is impacted by the time when an event/PMU is added. While the order for a child is impacted by the event order in the pinned_groups and flexible_groups. So the order of pmu_ctx_list in the parent and child may be different. To fix this problem, insert the perf_event_pmu_context to its proper place after iteration of the pmu_ctx_list. The follow testcase can trigger above warning: # perf record -e cycles --call-graph lbr -- taskset -c 3 ./a.out & # perf stat -e cpu-clock,cs -p xxx // xxx is the pid of a.out test.c void main() { int count = 0; pid_t pid; printf("%d running\n", getpid()); sleep(30); printf("running\n"); pid = fork(); if (pid == -1) { printf("fork error\n"); return; } if (pid == 0) { while (1) { count++; } } else { while (1) { count++; } } } The testcase first opens an LBR event, so it will allocate task_ctx_data, and then open tracepoint and software events, so the parent context will have 3 different perf_event_pmu_contexts. On inheritance, child ctx will insert the perf_event_pmu_context in another order and the warning will trigger. [ mingo: Tidied up the changelog. ]
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:13 | linux | 6.12.19-1 | DEBIAN-CVE-2025-21895 |
| Debian:14 | linux | 6.12.19-1 | DEBIAN-CVE-2025-21895 |
| 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-21895 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1039.41 | USN-7764-1 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1039.41 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| 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-21895 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1038.44 | UBUNTU-CVE-2025-21895 |
| 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-21895 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | 6.11.0-1015.15~24.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1036.42~22.04.1 | UBUNTU-CVE-2025-21895 |
| 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-5.19 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2025-21895 |
| 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-21895 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1040.42 | USN-7764-1 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1040.42 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | 6.11.0-1015.15~24.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1040.42~22.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1040.42~22.04.1 | USN-7766-1 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1036.40 | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1036.40 | USN-7764-1 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1023.25 | USN-7764-1 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1023.25 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | 6.11.0-26.26~24.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| 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 | USN-7801-1 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-85.85~22.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1037.37 | USN-7779-1 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1037.37 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1037.37~22.04.1 | UBUNTU-CVE-2025-21895 |
| 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-21895 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-84.84.1 | USN-7764-1 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-84.84.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | 6.11.0-1014.15~24.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-84.84.1~22.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-84.84.1~22.04.1 | USN-7764-1 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1039.42 | UBUNTU-CVE-2025-21895 |
| 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-21895 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1039.42~22.04.1 | UBUNTU-CVE-2025-21895 |
| 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 | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1039.42.1 | USN-7765-1 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1010.10 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1022.22 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1037.38 | USN-7801-2 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1037.38 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1037.38~22.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1037.38~22.04.1 | USN-7801-3 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1039.43 | USN-7790-1 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1039.43 | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-84.84~22.04.1 | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2025-21895 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1018.19 | UBUNTU-CVE-2025-21895 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | bd27568117664b8b3e259721393df420ed51f57b – before f0c3971405cef6892844016aa710121a02da3a23bd27568117664b8b3e259721393df420ed51f57b – before 7d582eb6e4e100959ba07083d7563453c8c2a343bd27568117664b8b3e259721393df420ed51f57b – before 3e812a70732d84b7873cea61a7f6349b9a9dcbf5bd27568117664b8b3e259721393df420ed51f57b – before 2016066c66192a99d9e0ebf433789c490a6785a2 |
| Linux | Linux | 6.2 |