# CVE-2025-37878: perf/core: Fix WARN\_ON(!ctx) in \_\_free\_event() for partial init

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.27% (percentile 13, 2026-11-26)
- **CWE:** CWE-617
- **Published:** 2025-05-09T06:45:42.459Z
- **Modified:** 2026-11-05T21:17:56.843Z

## Who should check

- Anyone running Linux \>= 7ef5aa081f989ecfecc1df02068a80aebbd3ec31, \< 90dc6c1e3b200812da8d0aa030e1b7fda8226d0e; \>= 1209b0b29fd472e7dbd2b06544b019dd9f9b7e51, \< cb56cd11feabf99e08bc18960700a53322ffcea7; \>= c70ca298036c58a88686ff388d3d367e9d21acf0, \< 0ba3a4ab76fd3367b9cb680cad70182c896c795c; 315a50c6b1c6ce191f19f3372935d8e2ed9b53a6; \>= 6.13.12, \< 6.14
- Anyone running Linux \>= 6.12.24, \< 6.12.26; \>= 6.14.3, \< 6.14.5

## Description

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

perf/core: Fix WARN\_ON(!ctx) in \_\_free\_event() for partial init

Move the get\_ctx(child\_ctx) call and the child\_event-\>ctx assignment to
occur immediately after the child event is allocated. Ensure that
child\_event-\>ctx is non-NULL before any subsequent error path within
inherit\_event calls free\_event(), 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 child\_event was created. Later, an early
validity check for child\_event was added before the
refcount/assignment. Even later, a WARN\_ON\_ONCE() cleanup check was
added, assuming event-\>ctx is valid if the pmu\_ctx is valid.
The problem is that the WARN\_ON\_ONCE() could trigger after the initial
check passed but before child\_event-\>ctx was assigned, violating its
precondition. The solution is to assign child\_event-\>ctx right after
its initial validation. This ensures the context exists for any
subsequent checks or cleanup routines, resolving the WARN\_ON\_ONCE().

To resolve it, defer the refcount update and child\_event-\>ctx assignment
directly after child\_event-\>pmu\_ctx is set but before checking if the
parent event is orphaned. The cleanup routine depends on
event-\>pmu\_ctx being non-NULL before it verifies event-\>ctx is
non-NULL. This also maintains the author's original intent of passing
in child\_ctx to find\_get\_pmu\_context before its refcount/assignment.

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

## Affected and fixed versions

- Linux: \>= 7ef5aa081f989ecfecc1df02068a80aebbd3ec31, \< 90dc6c1e3b200812da8d0aa030e1b7fda8226d0e; \>= 1209b0b29fd472e7dbd2b06544b019dd9f9b7e51, \< cb56cd11feabf99e08bc18960700a53322ffcea7; \>= c70ca298036c58a88686ff388d3d367e9d21acf0, \< 0ba3a4ab76fd3367b9cb680cad70182c896c795c; 315a50c6b1c6ce191f19f3372935d8e2ed9b53a6; \>= 6.13.12, \< 6.14 (cvelist)
- Linux: \>= 6.12.24, \< 6.12.26; \>= 6.14.3, \< 6.14.5 (cvelist)

## Mitigation

- Upgrade Linux to 6.14 or later.
- Upgrade Linux to 6.14.5 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-37878. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-37878.md
Affected: Linux >= 7ef5aa081f989ecfecc1df02068a80aebbd3ec31, < 90dc6c1e3b200812da8d0aa030e1b7fda8226d0e; >= 1209b0b29fd472e7dbd2b06544b019dd9f9b7e51, < cb56cd11feabf99e08bc18960700a53322ffcea7; >= c70ca298036c58a88686ff388d3d367e9d21acf0, < 0ba3a4ab76fd3367b9cb680cad70182c896c795c; 315a50c6b1c6ce191f19f33729…
Fixed in: Linux 90dc6c1e3b200812da8d0aa030e1b7fda8226d0e, Linux 0ba3a4ab76fd3367b9cb680cad70182c896c795c, Linux 6.14, Linux 6.12.26, Linux 6.14.5

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-37878 being exploited?

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 7ef5aa081f989ecfecc1df02068a80aebbd3ec31, \< 90dc6c1e3b200812da8d0aa030e1b7fda8226d0e; \>= 1209b0b29fd472e7dbd2b06544b019dd9f9b7e51, \< cb56cd11feabf99e08bc18960700a53322ffcea7; \>= c70ca298036c58a88686ff388d3d367e9d21acf0, \< 0ba3a4ab76fd3367b9cb680cad70182c896c795c; 315a50c6b1c6ce191f19f3372935d8e2ed9b53a6; \>= 6.13.12, \< 6.14; Linux \>= 6.12.24, \< 6.12.26; \>= 6.14.3, \< 6.14.5.

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

Yes. Fixed in Linux 90dc6c1e3b200812da8d0aa030e1b7fda8226d0e, Linux 0ba3a4ab76fd3367b9cb680cad70182c896c795c, Linux 6.14, Linux 6.12.26, Linux 6.14.5. Upgrade Linux to 6.14 or later. Upgrade Linux to 6.14.5 or later.

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

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/90dc6c1e3b200812da8d0aa030e1b7fda8226d0e>
- patch: <https://git.kernel.org/stable/c/cb56cd11feabf99e08bc18960700a53322ffcea7>
- patch: <https://git.kernel.org/stable/c/0ba3a4ab76fd3367b9cb680cad70182c896c795c>

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

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