# CVE-2025-40122: perf/x86/intel: Fix IA32\_PMC\_x\_CFG\_B MSRs access error

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.26% (percentile 11, 2026-11-26)
- **Published:** 2025-11-12T10:23:19.271Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= ec980e4facef8110f6fce27e5b6344660117f01f, \< c6cca4213b618c92e4972919ee568f0fb87313b1; \>= ec980e4facef8110f6fce27e5b6344660117f01f, \< 43796f30507802d93ead2dc44fc9637f34671a89
- Anyone running Linux 6.16

## Description

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

perf/x86/intel: Fix IA32\_PMC\_x\_CFG\_B MSRs access error

When running perf\_fuzzer on PTL, sometimes the below "unchecked MSR
 access error" is seen when accessing IA32\_PMC\_x\_CFG\_B MSRs.

\[   55.611268\] unchecked MSR access error: WRMSR to 0x1986 (tried to write 0x0000000200000001) at rIP: 0xffffffffac564b28 (native\_write\_msr+0x8/0x30)
\[   55.611280\] Call Trace:
\[   55.611282\]  \<TASK\>
\[   55.611284\]  ? intel\_pmu\_config\_acr+0x87/0x160
\[   55.611289\]  intel\_pmu\_enable\_acr+0x6d/0x80
\[   55.611291\]  intel\_pmu\_enable\_event+0xce/0x460
\[   55.611293\]  x86\_pmu\_start+0x78/0xb0
\[   55.611297\]  x86\_pmu\_enable+0x218/0x3a0
\[   55.611300\]  ? x86\_pmu\_enable+0x121/0x3a0
\[   55.611302\]  perf\_pmu\_enable+0x40/0x50
\[   55.611307\]  ctx\_resched+0x19d/0x220
\[   55.611309\]  \_\_perf\_install\_in\_context+0x284/0x2f0
\[   55.611311\]  ? \_\_pfx\_remote\_function+0x10/0x10
\[   55.611314\]  remote\_function+0x52/0x70
\[   55.611317\]  ? \_\_pfx\_remote\_function+0x10/0x10
\[   55.611319\]  generic\_exec\_single+0x84/0x150
\[   55.611323\]  smp\_call\_function\_single+0xc5/0x1a0
\[   55.611326\]  ? \_\_pfx\_remote\_function+0x10/0x10
\[   55.611329\]  perf\_install\_in\_context+0xd1/0x1e0
\[   55.611331\]  ? \_\_pfx\_\_\_perf\_install\_in\_context+0x10/0x10
\[   55.611333\]  \_\_do\_sys\_perf\_event\_open+0xa76/0x1040
\[   55.611336\]  \_\_x64\_sys\_perf\_event\_open+0x26/0x30
\[   55.611337\]  x64\_sys\_call+0x1d8e/0x20c0
\[   55.611339\]  do\_syscall\_64+0x4f/0x120
\[   55.611343\]  entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e

On PTL, GP counter 0 and 1 doesn't support auto counter reload feature,
thus it would trigger a \#GP when trying to write 1 on bit 0 of CFG\_B MSR
which requires to enable auto counter reload on GP counter 0.

The root cause of causing this issue is the check for auto counter
reload (ACR) counter mask from user space is incorrect in
intel\_pmu\_acr\_late\_setup() helper. It leads to an invalid ACR counter
mask from user space could be set into hw.config1 and then written into
CFG\_B MSRs and trigger the MSR access warning.

e.g., User may create a perf event with ACR counter mask (config2=0xcb),
and there is only 1 event created, so "cpuc-\>n\_events" is 1.

The correct check condition should be "i + idx \>= cpuc-\>n\_events"
instead of "i + idx \> cpuc-\>n\_events" (it looks a typo). Otherwise,
the counter mask would traverse twice and an invalid "cpuc-\>assign\[1\]"
bit (bit 0) is set into hw.config1 and cause MSR accessing error.

Besides, also check if the ACR counter mask corresponding events are
ACR events. If not, filter out these counter mask. If a event is not a
ACR event, it could be scheduled to an HW counter which doesn't support
ACR. It's invalid to add their counter index in ACR counter mask.

Furthermore, remove the WARN\_ON\_ONCE() since it's easily triggered as
user could set any invalid ACR counter mask and the warning message
could mislead users.

## Affected and fixed versions

- Linux: \>= ec980e4facef8110f6fce27e5b6344660117f01f, \< c6cca4213b618c92e4972919ee568f0fb87313b1; \>= ec980e4facef8110f6fce27e5b6344660117f01f, \< 43796f30507802d93ead2dc44fc9637f34671a89 (cvelist)
- Linux: 6.16 (cvelist)

## Mitigation

- Upgrade Linux to 43796f30507802d93ead2dc44fc9637f34671a89 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-40122. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40122.md
Affected: Linux >= ec980e4facef8110f6fce27e5b6344660117f01f, < c6cca4213b618c92e4972919ee568f0fb87313b1; >= ec980e4facef8110f6fce27e5b6344660117f01f, < 43796f30507802d93ead2dc44fc9637f34671a89; Linux 6.16
Fixed in: Linux 43796f30507802d93ead2dc44fc9637f34671a89

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

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= ec980e4facef8110f6fce27e5b6344660117f01f, \< c6cca4213b618c92e4972919ee568f0fb87313b1; \>= ec980e4facef8110f6fce27e5b6344660117f01f, \< 43796f30507802d93ead2dc44fc9637f34671a89; Linux 6.16.

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

Yes. Fixed in Linux 43796f30507802d93ead2dc44fc9637f34671a89. Upgrade Linux to 43796f30507802d93ead2dc44fc9637f34671a89 or later.

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

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

- other: <https://git.kernel.org/stable/c/c6cca4213b618c92e4972919ee568f0fb87313b1>
- other: <https://git.kernel.org/stable/c/43796f30507802d93ead2dc44fc9637f34671a89>

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

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