# CVE-2026-31588: KVM: x86: Use scratch field in MMIO fragment to hold small write values

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

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; 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.20% (percentile 11, 2026-12-02)
- **CWE:** CWE-416
- **Published:** 2026-04-24T14:42:16.288Z
- **Modified:** 2026-11-11T23:10:00.263Z

## Who should check

- Anyone running Linux \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 019d0bd32b9a4646ba35d904907452039e2db700; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 4569c66dd9e94a22cd0796b6514a8b25ffff16a1; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 52570e73d48f1c73836d37e594667117b4c2a5a8; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< dc6a6c3db3a4eca7e747cfc46e22c08d016c68f7; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< b5a02d37eb0739f462fa12df449ab9b3480c783b; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 22d2ff69d487a32a8b88f9c970120fc2daa08a77; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 2b83d91e9ae92fe1258d7040a32430bbb3bb7d6e; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 3a7b6d75c8f85b09dea893f64a85a356bcf6c3fe; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 0b16e69d17d8c35c5c9d5918bf596c75a44655d3
- Anyone running Linux 3.5

## Description

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

KVM: x86: Use scratch field in MMIO fragment to hold small write values

When exiting to userspace to service an emulated MMIO write, copy the
to-be-written value to a scratch field in the MMIO fragment if the size
of the data payload is 8 bytes or less, i.e. can fit in a single chunk,
instead of pointing the fragment directly at the source value.

This fixes a class of use-after-free bugs that occur when the emulator
initiates a write using an on-stack, local variable as the source, the
write splits a page boundary, \*and\* both pages are MMIO pages.  Because
KVM's ABI only allows for physically contiguous MMIO requests, accesses
that split MMIO pages are separated into two fragments, and are sent to
userspace one at a time.  When KVM attempts to complete userspace MMIO in
response to KVM\_RUN after the first fragment, KVM will detect the second
fragment and generate a second userspace exit, and reference the on-stack
variable.

The issue is most visible if the second KVM\_RUN is performed by a separate
task, in which case the stack of the initiating task can show up as truly
freed data.

  ==================================================================
  BUG: KASAN: use-after-free in complete\_emulated\_mmio+0x305/0x420
  Read of size 1 at addr ffff888009c378d1 by task syz-executor417/984

  CPU: 1 PID: 984 Comm: syz-executor417 Not tainted 5.10.0-182.0.0.95.h2627.eulerosv2r13.x86\_64 \#3
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 Call Trace:
  dump\_stack+0xbe/0xfd
  print\_address\_description.constprop.0+0x19/0x170
  \_\_kasan\_report.cold+0x6c/0x84
  kasan\_report+0x3a/0x50
  check\_memory\_region+0xfd/0x1f0
  memcpy+0x20/0x60
  complete\_emulated\_mmio+0x305/0x420
  kvm\_arch\_vcpu\_ioctl\_run+0x63f/0x6d0
  kvm\_vcpu\_ioctl+0x413/0xb20
  \_\_se\_sys\_ioctl+0x111/0x160
  do\_syscall\_64+0x30/0x40
  entry\_SYSCALL\_64\_after\_hwframe+0x67/0xd1
  RIP: 0033:0x42477d
  Code: \<48\> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
  RSP: 002b:00007faa8e6890e8 EFLAGS: 00000246 ORIG\_RAX: 0000000000000010
  RAX: ffffffffffffffda RBX: 00000000004d7338 RCX: 000000000042477d
  RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000005
  RBP: 00000000004d7330 R08: 00007fff28d546df R09: 0000000000000000
  R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004d733c
  R13: 0000000000000000 R14: 000000000040a200 R15: 00007fff28d54720

  The buggy address belongs to the page:
  page:0000000029f6a428 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x9c37
  flags: 0xfffffc0000000(node=0\|zone=1\|lastcpupid=0x1fffff)
  raw: 000fffffc0000000 0000000000000000 ffffea0000270dc8 0000000000000000
  raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected

  Memory state around the buggy address:
  ffff888009c37780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  ffff888009c37800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  \>ffff888009c37880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                   ^
  ffff888009c37900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  ffff888009c37980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  ==================================================================

The bug can also be reproduced with a targeted KVM-Unit-Test by hacking
KVM to fill a large on-stack variable in complete\_emulated\_mmio(), i.e. by
overwrite the data value with garbage.

Limit the use of the scratch fields to 8-byte or smaller accesses, and to
just writes, as larger accesses and reads are not affected thanks to
implementation details in the emulator, but add a sanity check to ensure
those details don't change in the future.  Specifically, KVM never uses
on-stack variables for accesses larger that 8 bytes, e.g. uses an operand
in the emulator context, and \*al
---truncated---

## Affected and fixed versions

- Linux: \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 019d0bd32b9a4646ba35d904907452039e2db700; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 4569c66dd9e94a22cd0796b6514a8b25ffff16a1; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 52570e73d48f1c73836d37e594667117b4c2a5a8; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< dc6a6c3db3a4eca7e747cfc46e22c08d016c68f7; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< b5a02d37eb0739f462fa12df449ab9b3480c783b; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 22d2ff69d487a32a8b88f9c970120fc2daa08a77; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 2b83d91e9ae92fe1258d7040a32430bbb3bb7d6e; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 3a7b6d75c8f85b09dea893f64a85a356bcf6c3fe; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 0b16e69d17d8c35c5c9d5918bf596c75a44655d3 (cvelist)
- Linux: 3.5 (cvelist)

## Mitigation

- Upgrade Linux to 0b16e69d17d8c35c5c9d5918bf596c75a44655d3 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-31588.md
Affected: Linux >= f78146b0f9230765c6315b2e14f56112513389ad, < 019d0bd32b9a4646ba35d904907452039e2db700; >= f78146b0f9230765c6315b2e14f56112513389ad, < 4569c66dd9e94a22cd0796b6514a8b25ffff16a1; >= f78146b0f9230765c6315b2e14f56112513389ad, < 52570e73d48f1c73836d37e594667117b4c2a5a8; >= f78146b0f9230765c6315b2…
Fixed in: Linux 019d0bd32b9a4646ba35d904907452039e2db700, Linux 4569c66dd9e94a22cd0796b6514a8b25ffff16a1, Linux 52570e73d48f1c73836d37e594667117b4c2a5a8, Linux 22d2ff69d487a32a8b88f9c970120fc2daa08a77, Linux 2b83d91e9ae92fe1258d7040a32430bbb3bb7d6e, Linux 3a7b6d75c8f85b09dea893f64a85a356bcf6c3fe, Linux 0b16e…

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-2026-31588 being exploited?

There is no confirmed exploitation: CVE-2026-31588 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.20% chance of exploitation in the next 30 days (as of 2026-12-02).

### How serious is CVE-2026-31588?

High: CVSS 8.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-31588?

Linux \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 019d0bd32b9a4646ba35d904907452039e2db700; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 4569c66dd9e94a22cd0796b6514a8b25ffff16a1; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 52570e73d48f1c73836d37e594667117b4c2a5a8; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< dc6a6c3db3a4eca7e747cfc46e22c08d016c68f7; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< b5a02d37eb0739f462fa12df449ab9b3480c783b; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 22d2ff69d487a32a8b88f9c970120fc2daa08a77; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 2b83d91e9ae92fe1258d7040a32430bbb3bb7d6e; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 3a7b6d75c8f85b09dea893f64a85a356bcf6c3fe; \>= f78146b0f9230765c6315b2e14f56112513389ad, \< 0b16e69d17d8c35c5c9d5918bf596c75a44655d3; Linux 3.5.

### Is there a fix for CVE-2026-31588?

Yes. Fixed in Linux 019d0bd32b9a4646ba35d904907452039e2db700, Linux 4569c66dd9e94a22cd0796b6514a8b25ffff16a1, Linux 52570e73d48f1c73836d37e594667117b4c2a5a8, Linux 22d2ff69d487a32a8b88f9c970120fc2daa08a77, Linux 2b83d91e9ae92fe1258d7040a32430bbb3bb7d6e, Linux 3a7b6d75c8f85b09dea893f64a85a356bcf6c3fe, Linux 0b16e69d17d8c35c5c9d5918bf596c75a44655d3. Upgrade Linux to 0b16e69d17d8c35c5c9d5918bf596c75a44655d3 or later.

### How do I check if I'm affected by CVE-2026-31588?

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/dc6a6c3db3a4eca7e747cfc46e22c08d016c68f7>
- patch: <https://git.kernel.org/stable/c/b5a02d37eb0739f462fa12df449ab9b3480c783b>
- patch: <https://git.kernel.org/stable/c/22d2ff69d487a32a8b88f9c970120fc2daa08a77>
- patch: <https://git.kernel.org/stable/c/2b83d91e9ae92fe1258d7040a32430bbb3bb7d6e>
- patch: <https://git.kernel.org/stable/c/3a7b6d75c8f85b09dea893f64a85a356bcf6c3fe>
- patch: <https://git.kernel.org/stable/c/0b16e69d17d8c35c5c9d5918bf596c75a44655d3>
- other: <https://git.kernel.org/stable/c/019d0bd32b9a4646ba35d904907452039e2db700>
- other: <https://git.kernel.org/stable/c/4569c66dd9e94a22cd0796b6514a8b25ffff16a1>
- other: <https://git.kernel.org/stable/c/52570e73d48f1c73836d37e594667117b4c2a5a8>

## 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-2026-31588>

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