# CVE-2022-49781: perf/x86/amd: Fix crash due to race between amd\_pmu\_enable\_all, perf NMI and throttling

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

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; 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.16% (percentile 3, 2026-11-26)
- **CWE:** CWE-362
- **Published:** 2025-05-01T14:09:15.775Z
- **Modified:** 2026-11-05T20:17:10.827Z

## Who should check

- Anyone running Linux \>= ada543459cab7f653dcacdaba4011a8bb19c627c, \< fd5e454b856ed86b090336e269695d9908609b71; \>= ada543459cab7f653dcacdaba4011a8bb19c627c, \< baa014b9543c8e5e94f5d15b66abfe60750b8284
- Anyone running Linux 5.19

## Description

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

perf/x86/amd: Fix crash due to race between amd\_pmu\_enable\_all, perf NMI and throttling

amd\_pmu\_enable\_all() does:

      if (!test\_bit(idx, cpuc-\>active\_mask))
              continue;

      amd\_pmu\_enable\_event(cpuc-\>events\[idx\]);

A perf NMI of another event can come between these two steps. Perf NMI
handler internally disables and enables \_all\_ events, including the one
which nmi-intercepted amd\_pmu\_enable\_all() was in process of enabling.
If that unintentionally enabled event has very low sampling period and
causes immediate successive NMI, causing the event to be throttled,
cpuc-\>events\[idx\] and cpuc-\>active\_mask gets cleared by x86\_pmu\_stop().
This will result in amd\_pmu\_enable\_event() getting called with event=NULL
when amd\_pmu\_enable\_all() resumes after handling the NMIs. This causes a
kernel crash:

  BUG: kernel NULL pointer dereference, address: 0000000000000198
  \#PF: supervisor read access in kernel mode
  \#PF: error\_code(0x0000) - not-present page
  \[...\]
  Call Trace:
   \<TASK\>
   amd\_pmu\_enable\_all+0x68/0xb0
   ctx\_resched+0xd9/0x150
   event\_function+0xb8/0x130
   ? hrtimer\_start\_range\_ns+0x141/0x4a0
   ? perf\_duration\_warn+0x30/0x30
   remote\_function+0x4d/0x60
   \_\_flush\_smp\_call\_function\_queue+0xc4/0x500
   flush\_smp\_call\_function\_queue+0x11d/0x1b0
   do\_idle+0x18f/0x2d0
   cpu\_startup\_entry+0x19/0x20
   start\_secondary+0x121/0x160
   secondary\_startup\_64\_no\_verify+0xe5/0xeb
   \</TASK\>

amd\_pmu\_disable\_all()/amd\_pmu\_enable\_all() calls inside perf NMI handler
were recently added as part of BRS enablement but I'm not sure whether
we really need them. We can just disable BRS in the beginning and enable
it back while returning from NMI. This will solve the issue by not
enabling those events whose active\_masks are set but are not yet enabled
in hw pmu.

## Affected and fixed versions

- Linux: \>= ada543459cab7f653dcacdaba4011a8bb19c627c, \< fd5e454b856ed86b090336e269695d9908609b71; \>= ada543459cab7f653dcacdaba4011a8bb19c627c, \< baa014b9543c8e5e94f5d15b66abfe60750b8284 (cvelist)
- Linux: 5.19 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49781. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49781.md
Affected: Linux >= ada543459cab7f653dcacdaba4011a8bb19c627c, < fd5e454b856ed86b090336e269695d9908609b71; >= ada543459cab7f653dcacdaba4011a8bb19c627c, < baa014b9543c8e5e94f5d15b66abfe60750b8284; Linux 5.19
Fixed in: no fixed version listed yet

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-2022-49781 being exploited?

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

### How serious is CVE-2022-49781?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2022-49781?

Linux \>= ada543459cab7f653dcacdaba4011a8bb19c627c, \< fd5e454b856ed86b090336e269695d9908609b71; \>= ada543459cab7f653dcacdaba4011a8bb19c627c, \< baa014b9543c8e5e94f5d15b66abfe60750b8284; Linux 5.19.

### Is there a fix for CVE-2022-49781?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-49781?

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/fd5e454b856ed86b090336e269695d9908609b71>
- patch: <https://git.kernel.org/stable/c/baa014b9543c8e5e94f5d15b66abfe60750b8284>

## 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-2022-49781>

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