CVE-2025-37878: perf/core: Fix WARN_ON(!ctx) in __free_event() for partial init

Published May 9, 2025
·
Updated

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

perf/core: Fix WARNON(!ctx) in freeevent() for partial init

Move the getctx(childctx) call and the childevent->ctx assignment to occur immediately after the child event is allocated. Ensure that childevent->ctx is non-NULL before any subsequent error path within inheritevent calls freeevent(), satisfying the assumptions of the cleanup code.

Details:

There's no clear Fixes tag, because this bug is a side-effect of multiple interacting commits over time (up to 15 years old), not a single regression.

The code initially incremented refcount then assigned context immediately after the childevent was created. Later, an early validity check for childevent was added before the refcount/assignment. Even later, a WARNONONCE() cleanup check was added, assuming event->ctx is valid if the pmuctx is valid. The problem is that the WARNONONCE() could trigger after the initial check passed but before childevent->ctx was assigned, violating its precondition. The solution is to assign childevent->ctx right after its initial validation. This ensures the context exists for any subsequent checks or cleanup routines, resolving the WARNONONCE().

To resolve it, defer the refcount update and childevent->ctx assignment directly after childevent->pmuctx is set but before checking if the parent event is orphaned. The cleanup routine depends on event->pmuctx being non-NULL before it verifies event->ctx is non-NULL. This also maintains the author's original intent of passing in childctx to findgetpmucontext before its refcount/assignment.

[ mingo: Expanded the changelog from another email by Gabriel Shahrouzi. ]

Affected Software

8 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel<6.6.89
Linux Linux kernel>=6.7<6.12.26
Linux Linux kernel>=6.13<6.14.5
Linux Linux kernel=6.15-rc1
Microsoft cbl2 kernel 5.15.186.1-1
Microsoft azl3 kernel 6.6.92.2-1<6.6.92.2-1
6.6.92.2-1
Microsoft azl3 kernel 6.6.85.1-4<6.6.92.2-1
6.6.92.2-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 6.6.92.2-1

Event History

May 9, 2025
CVE Published
via MITRE·06:45 AM
Data Sourced
via MITRE·06:45 AM
Description
Data Sourced
via NVD·07:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 11, 2025
Data Sourced
via Microsoft·12:00 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Updated
via Microsoft·07:00 AM
SeverityWeaknessAffected Software
Updated
via Microsoft·07:00 AM
WeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-37878?

CVE-2025-37878 is categorized as a moderate severity vulnerability in the Linux kernel.

2

How do I fix CVE-2025-37878?

To fix CVE-2025-37878, update your Linux kernel to the latest patched version.

3

Which versions of Linux Kernel are affected by CVE-2025-37878?

CVE-2025-37878 affects specific versions of the Linux kernel that are vulnerable to the described issue.

4

What type of vulnerability is CVE-2025-37878?

CVE-2025-37878 is a kernel-level vulnerability specifically related to event management in the performance subsystem.

5

Is CVE-2025-37878 actively exploited?

As of now, there are no reports indicating that CVE-2025-37878 is being actively exploited in the wild.

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