CVE-2026-52969: KVM: Reject wrapped offset in kvm_reset_dirty_gfn()

Published Jun 24, 2026
·
Updated

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

KVM: Reject wrapped offset in kvmresetdirtygfn()

kvmresetdirtygfn() guards the gfn range with

if (!memslot || (offset + fls(mask)) >= memslot->npages) return;

but offset is u64 and the addition is unchecked. The check can be silently bypassed by a u64 wrap.

The dirty ring backing those entries is MAPSHARED at KVMDIRTYLOGPAGEOFFSET of the vcpu fd, so the VMM can rewrite the slot and offset fields of any entry between when the kernel pushes them and when KVMRESETDIRTYRINGS consumes them. On reset, kvmdirtyringreset() re-reads the values via READONCE() and feeds them straight back into this check; only the flags handshake is treated as the handover, the slot/offset payload is taken on trust.

Crafting two entries

entry[i].offset = 0xffffffffffffffc1 entry[i+1].offset = 0

makes the coalescing loop in kvmdirtyringreset() compute

delta = (s64)(0 - 0xffffffffffffffc1) = 63

which falls in [0, BITSPERLONG), so it folds entry[i+1] into the existing mask by setting bit 63. The trailing kvmresetdirtygfn() call then sees offset = 0xffffffffffffffc1 and fls(mask) = 63; the sum is 0 in u64 and the bounds check passes.

That offset propagates into kvmarchmmuenablelogdirtyptmasked() unchanged. On the legacy MMU path -- kvmmemslotshavermaps() == true, i.e. shadow paging, any VM that has allocated shadow roots, or a write-tracked slot -- it reaches gfntormap(), which indexes slot->arch.rmap[0][] with a near-U64MAX gfn. That is an out-of-bounds load of a kvmrmaphead, followed by a conditional clear of PTWRITABLEMASK in whatever the loaded pointer points at. The path is reachable from any process holding /dev/kvm.

Range-check offset on its own first, so the addition cannot wrap. memslot->npages is bounded well below U64MAX, so once offset < npages holds, offset + fls(mask) (with fls(mask) < BITSPERLONG) stays in range.

Affected Software

11 affected componentsFixes available
Linux Linux kernel
Microsoft azl3 kernel 6.6.139.1-1<6.6.143.1-1
6.6.143.1-1
Linux Linux kernel>=5.11<5.15.209
Linux Linux kernel>=5.16<6.1.175
Linux Linux kernel>=6.2<6.6.141
Linux Linux kernel>=6.7<6.12.91
Linux Linux kernel>=6.13<6.18.33
Linux Linux kernel>=6.19<7.0.10
Linux Linux kernel=7.1-rc1
Linux Linux kernel=7.1-rc2
Linux Linux kernel=7.1-rc3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 6.6.143.1-1
  2. Configuration

    Update the Linux kernel KVM dirty ring reset logic so kvm_reset_dirty_gfn() rejects wrapped offset values from KVM_DIRTY_LOG_PAGE_OFFSET and performs a range-check on offset before evaluating (offset + __fls(mask)) to prevent u64 wrap into an out-of-bounds rmap load via gfn_to_rmap().

    Linux kernel KVM (kvm_reset_dirty_gfn / kvm_reset_dirty_rings) KVM_DIRTY_LOG_PAGE_OFFSET (vcpu fd) offset handling = Reject wrapped offset / add range-check on offset before performing unchecked u64 addition

Event History

Jun 24, 2026
CVE Published
via MITRE·04:28 PM
Data Sourced
via MITRE·04:28 PM
Description
Data Sourced
via NVD·05:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·06:11 PM
DescriptionSeverityAffected Software
Jun 27, 2026
Data Sourced
via Microsoft·08:14 AM
DescriptionSeverityWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203