CVE-2025-21895: perf/core: Order the PMU list to fix warning about unordered pmu_ctx_list

Published Apr 1, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

perf/core: Order the PMU list to fix warning about unordered pmuctxlist

Syskaller triggers a warning due to prevepc->pmu != nextepc->pmu in perfeventswaptaskctxdata(). vmcore shows that two lists have the same perfeventpmucontext, but not in the same order.

The problem is that the order of pmuctxlist 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 pinnedgroups and flexiblegroups. So the order of pmuctxlist in the parent and child may be different.

To fix this problem, insert the perfeventpmucontext to its proper place after iteration of the pmuctxlist.

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; pidt 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 taskctxdata, and then open tracepoint and software events, so the parent context will have 3 different perfeventpmucontexts. On inheritance, child ctx will insert the perfeventpmucontext in another order and the warning will trigger.

[ mingo: Tidied up the changelog. ]

Affected Software

14 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=6.2<6.6.81
Linux Linux kernel>=6.7<6.12.18
Linux Linux kernel>=6.13<6.13.6
Linux Linux kernel=6.14-rc1
Linux Linux kernel=6.14-rc2
Linux Linux kernel=6.14-rc3
Linux Linux kernel=6.14-rc4
debian/linux<6.12.19-1
6.12.19-1
debian/linux<6.12.19-1
6.12.19-1
linux/kernel>=6.2.0<6.6.81
6.6.81
linux/kernel>=6.7.0<6.12.18
6.12.18
linux/kernel>=6.13.0<6.13.6
6.13.6
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.19-1
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.81
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.18
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.13.6
  5. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.15-1

Event History

Apr 1, 2025
CVE Published
via MITRE·03:26 PM
Data Sourced
via MITRE·03:26 PM
Description
Data Sourced
via OSV·03:26 PM
DescriptionAffected Software
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·04:15 PM
Severity

Frequently Asked Questions

1

What is the severity of CVE-2025-21895?

The severity of CVE-2025-21895 has not been explicitly rated but is related to a performance issue in the Linux kernel.

2

How do I fix CVE-2025-21895?

To fix CVE-2025-21895, update your Linux kernel to the latest stable release that includes the fix.

3

Which versions of the Linux kernel are affected by CVE-2025-21895?

CVE-2025-21895 affects specific versions of the Linux kernel, particularly those prior to the patch that addresses the issue.

4

What are the implications of CVE-2025-21895 for Linux users?

Users of the affected Linux kernel versions may experience warnings related to the PMU list ordering during performance monitoring.

5

Is CVE-2025-21895 related to system performance?

Yes, CVE-2025-21895 concerns the performance monitoring unit which can affect system performance metrics.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203