# CVE-2025-40181: x86/kvm: Force legacy PCI hole to UC when overriding MTRRs for TDX/SNP

> 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.27% (percentile 13, 2026-11-26)
- **Published:** 2025-11-12T21:56:25.930Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 34ff466f74d0fe1db8956f9c245e2bb2c67f67bf; \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 91ab8a21bda2d2d2842b6159ac060d9100433a3c; \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 0dccbc75e18df85399a71933d60b97494110f559
- Anyone running Linux 6.12

## Description

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

x86/kvm: Force legacy PCI hole to UC when overriding MTRRs for TDX/SNP

When running as an SNP or TDX guest under KVM, force the legacy PCI hole,
i.e. memory between Top of Lower Usable DRAM and 4GiB, to be mapped as UC
via a forced variable MTRR range.

In most KVM-based setups, legacy devices such as the HPET and TPM are
enumerated via ACPI.  ACPI enumeration includes a Memory32Fixed entry, and
optionally a SystemMemory descriptor for an OperationRegion, e.g. if the
device needs to be accessed via a Control Method.

If a SystemMemory entry is present, then the kernel's ACPI driver will
auto-ioremap the region so that it can be accessed at will.  However, the
ACPI spec doesn't provide a way to enumerate the memory type of
SystemMemory regions, i.e. there's no way to tell software that a region
must be mapped as UC vs. WB, etc.  As a result, Linux's ACPI driver always
maps SystemMemory regions using ioremap\_cache(), i.e. as WB on x86.

The dedicated device drivers however, e.g. the HPET driver and TPM driver,
want to map their associated memory as UC or WC, as accessing PCI devices
using WB is unsupported.

On bare metal and non-CoCO, the conflicting requirements "work" as firmware
configures the PCI hole (and other device memory) to be UC in the MTRRs.
So even though the ACPI mappings request WB, they are forced to UC- in the
kernel's tracking due to the kernel properly handling the MTRR overrides,
and thus are compatible with the drivers' requested WC/UC-.

With force WB MTRRs on SNP and TDX guests, the ACPI mappings get their
requested WB if the ACPI mappings are established before the dedicated
driver code attempts to initialize the device.  E.g. if acpi\_init()
runs before the corresponding device driver is probed, ACPI's WB mapping
will "win", and result in the driver's ioremap() failing because the
existing WB mapping isn't compatible with the requested WC/UC-.

E.g. when a TPM is emulated by the hypervisor (ignoring the security
implications of relying on what is allegedly an untrusted entity to store
measurements), the TPM driver will request UC and fail:

  \[  1.730459\] ioremap error for 0xfed40000-0xfed45000, requested 0x2, got 0x0
  \[  1.732780\] tpm\_tis MSFT0101:00: probe with driver tpm\_tis failed with error -12

Note, the '0x2' and '0x0' values refer to "enum page\_cache\_mode", not x86's
memtypes (which frustratingly are an almost pure inversion; 2 == WB, 0 == UC).
E.g. tracing mapping requests for TPM TIS yields:

 Mapping TPM TIS with req\_type = 0
 WARNING: CPU: 22 PID: 1 at arch/x86/mm/pat/memtype.c:530 memtype\_reserve+0x2ab/0x460
 Modules linked in:
 CPU: 22 UID: 0 PID: 1 Comm: swapper/0 Tainted: G        W           6.16.0-rc7+ \#2 VOLUNTARY
 Tainted: \[W\]=WARN
 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/29/2025
 RIP: 0010:memtype\_reserve+0x2ab/0x460
  \_\_ioremap\_caller+0x16d/0x3d0
  ioremap\_cache+0x17/0x30
  x86\_acpi\_os\_ioremap+0xe/0x20
  acpi\_os\_map\_iomem+0x1f3/0x240
  acpi\_os\_map\_memory+0xe/0x20
  acpi\_ex\_system\_memory\_space\_handler+0x273/0x440
  acpi\_ev\_address\_space\_dispatch+0x176/0x4c0
  acpi\_ex\_access\_region+0x2ad/0x530
  acpi\_ex\_field\_datum\_io+0xa2/0x4f0
  acpi\_ex\_extract\_from\_field+0x296/0x3e0
  acpi\_ex\_read\_data\_from\_field+0xd1/0x460
  acpi\_ex\_resolve\_node\_to\_value+0x2ee/0x530
  acpi\_ex\_resolve\_to\_value+0x1f2/0x540
  acpi\_ds\_evaluate\_name\_path+0x11b/0x190
  acpi\_ds\_exec\_end\_op+0x456/0x960
  acpi\_ps\_parse\_loop+0x27a/0xa50
  acpi\_ps\_parse\_aml+0x226/0x600
  acpi\_ps\_execute\_method+0x172/0x3e0
  acpi\_ns\_evaluate+0x175/0x5f0
  acpi\_evaluate\_object+0x213/0x490
  acpi\_evaluate\_integer+0x6d/0x140
  acpi\_bus\_get\_status+0x93/0x150
  acpi\_add\_single\_object+0x43a/0x7c0
  acpi\_bus\_check\_add+0x149/0x3a0
  acpi\_bus\_check\_add\_1+0x16/0x30
  acpi\_ns\_walk\_namespace+0x22c/0x360
  acpi\_walk\_namespace+0x15c/0x170
  acpi\_bus\_scan+0x1dd/0x200
  acpi\_scan\_init+0xe5/0x2b0
  acpi\_init+0x264/0x5b0
  do\_one\_i
---truncated---

## Affected and fixed versions

- Linux: \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 34ff466f74d0fe1db8956f9c245e2bb2c67f67bf; \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 91ab8a21bda2d2d2842b6159ac060d9100433a3c; \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 0dccbc75e18df85399a71933d60b97494110f559 (cvelist)
- Linux: 6.12 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2025-40181.md
Affected: Linux >= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, < 34ff466f74d0fe1db8956f9c245e2bb2c67f67bf; >= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, < 91ab8a21bda2d2d2842b6159ac060d9100433a3c; >= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, < 0dccbc75e18df85399a71933d60b97494110f559; Linux 6.12
Fixed in: Linux 34ff466f74d0fe1db8956f9c245e2bb2c67f67bf, Linux 91ab8a21bda2d2d2842b6159ac060d9100433a3c, Linux 0dccbc75e18df85399a71933d60b97494110f559

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

There is no confirmed exploitation: CVE-2025-40181 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-40181?

It has no CVSS score yet. Unknown.

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

Linux \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 34ff466f74d0fe1db8956f9c245e2bb2c67f67bf; \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 91ab8a21bda2d2d2842b6159ac060d9100433a3c; \>= 8e690b817e38769dc2fa0e7473e5a5dc1fc25795, \< 0dccbc75e18df85399a71933d60b97494110f559; Linux 6.12.

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

Yes. Fixed in Linux 34ff466f74d0fe1db8956f9c245e2bb2c67f67bf, Linux 91ab8a21bda2d2d2842b6159ac060d9100433a3c, Linux 0dccbc75e18df85399a71933d60b97494110f559. Upgrade Linux to 0dccbc75e18df85399a71933d60b97494110f559 or later.

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

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/34ff466f74d0fe1db8956f9c245e2bb2c67f67bf>
- other: <https://git.kernel.org/stable/c/91ab8a21bda2d2d2842b6159ac060d9100433a3c>
- other: <https://git.kernel.org/stable/c/0dccbc75e18df85399a71933d60b97494110f559>

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

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