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

KVM: guest_memfd: Treat memslot binding offset+size as unsigned values

When binding a memslot to a guest_memfd file, treat the offset and size as
unsigned values to fix a bug where the sum of the two can result in a false
negative when checking for overflow against the size of the file. Passing
unsigned values also avoids relying on somewhat obscure checks in other
flows for safety, and tracks the offset and size as they are intended to be
tracked, as unsigned values.

On 64-bit kernels, the number of pages a memslot contains and thus the size
(and offset) of its guest_memfd binding are unsigned 64-bit values. Taking
the offset+size as an loff_t instead of a uoff_t inadvertently converts
the unsigned value to a signed value if the offset and/or size is massive.

Locally storing the offset and size as signed values is benign in and of
itself (though even that is *extremely* difficult to discern), but
operating on their sum is not.

For the offset, KVM explicitly checks against a negative value, which might
seem like a bug as KVM could incorrectly reject a legitimate binding, but
that's not actually the case as KVM_CREATE_GUEST_MEMFD takes a signed value
for its size, i.e. a would-be-negative offset is also greater than the
maximum possible size of any guest_memfd file.

Regarding the size, while KVM lacks an explicit check for a negative value,
i.e. seemingly has a flawed overflow check, KVM restricts the number of
pages in a single memslot to the largest positive signed 32-bit value:

if (id < KVM_USER_MEM_SLOTS &&
(mem->memory_size >> PAGE_SHIFT) > KVM_MEM_MAX_NR_PAGES)
return -EINVAL;

and so that maximum "size" will ever be is 0x7fffffff000.

The sum of the two is, however, problematic. While the size is restricted
by KVM's memslot logic, the offset is not, i.e. the offset is completely
unchecked until the "offset + size > i_size_read(inode)" check. If the
offset is the (nearly) largest possible _positive_ value, then adding size
to the offset can result in a signed, negative 64-bit value. When compared
against the size of the file (guaranteed to be positive), the negative sum
is always smaller, and KVM incorrectly allows the absurd offset.

Opportunistically add missing includes in kvm_mm.h (instead of relying on
its parents).
Published: 2026-07-25
Score: 7.0 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

This vulnerability arises in the Linux kernel’s KVM subsystem when binding a memslot to a guest_memfd file. The code incorrectly treats the memslot offset and size as signed 64‑bit values, allowing a signed overflow when the offset is very large and the size is added. The resulting negative sum is compared against the positive file length, always evaluating as smaller, so an absurdly high offset is accepted. This permits a KVM host to map guest memory at an offset beyond the underlying file size, potentially corrupting host memory or causing a crash. The flaw does not allow remote code execution directly from an external network host but can lead to denial of service or local privilege escalation if an attacker can control KVM guest memory configurations.

Affected Systems

Any 64‑bit Linux kernel running the KVM hypervisor and using the guest_memfd mechanism. The issue exists within the core kernel source, affecting all vendors that ship the unpatched kernel for KVM‑enabled hosts.

Risk and Exploitability

The CVSS score of 7.0 indicates a high severity, while the EPSS score of less than 1 % suggests a very low likelihood of observed exploitation. The vulnerability is not listed in the CISA KEV catalog. The flaw is exploitable only by code with the ability to configure guestmem mapping (typically privileged). Therefore, the overall risk is moderate, primarily requiring an update to the kernel to eliminate the signed overflow.

Generated by OpenCVE AI on August 3, 2026 at 19:27 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel version that includes the fix for CVE‑2026‑64283, which treats memslot offset and size as unsigned values. This is the most reliable remedy and eliminates the overflow.
  • If an immediate kernel upgrade is not feasible, disable or restrict guest_memfd usage in the host configuration to prevent large offset bindings, thereby blocking the unsafe path. This can be achieved by ensuring that guestmem access functions are limited or by removing KVM guest_memfd support entirely.
  • Verify the size of any guest_memfd bindings before allocation. Ensure that offset plus size does not exceed the file’s size and that both values are within the signed 32‑bit limit imposed by KVM_MEM_MAX_NR_PAGES. If misconfiguration is detected, abort the binding.
  • Implement kernel hardening options such as CONFIG_PAGE_TABLE_AUDIT or enable kprobe hacking checks to detect anomalous memory mappings. Regularly monitor dmesg and audit logs for KVM errors or invalid memory mapping attempts.
  • Consult the vendor’s security advisories for any platform‑specific mitigations and keep all security subsystems (SELinux, AppArmor) configured to restrict KVM services from untrusted code.

Generated by OpenCVE AI on August 3, 2026 at 19:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sun, 02 Aug 2026 14:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-680

Wed, 29 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.0, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}

threat_severity

Moderate


Mon, 27 Jul 2026 06:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-190
CWE-680

Sat, 25 Jul 2026 09:30:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: KVM: guest_memfd: Treat memslot binding offset+size as unsigned values When binding a memslot to a guest_memfd file, treat the offset and size as unsigned values to fix a bug where the sum of the two can result in a false negative when checking for overflow against the size of the file. Passing unsigned values also avoids relying on somewhat obscure checks in other flows for safety, and tracks the offset and size as they are intended to be tracked, as unsigned values. On 64-bit kernels, the number of pages a memslot contains and thus the size (and offset) of its guest_memfd binding are unsigned 64-bit values. Taking the offset+size as an loff_t instead of a uoff_t inadvertently converts the unsigned value to a signed value if the offset and/or size is massive. Locally storing the offset and size as signed values is benign in and of itself (though even that is *extremely* difficult to discern), but operating on their sum is not. For the offset, KVM explicitly checks against a negative value, which might seem like a bug as KVM could incorrectly reject a legitimate binding, but that's not actually the case as KVM_CREATE_GUEST_MEMFD takes a signed value for its size, i.e. a would-be-negative offset is also greater than the maximum possible size of any guest_memfd file. Regarding the size, while KVM lacks an explicit check for a negative value, i.e. seemingly has a flawed overflow check, KVM restricts the number of pages in a single memslot to the largest positive signed 32-bit value: if (id < KVM_USER_MEM_SLOTS && (mem->memory_size >> PAGE_SHIFT) > KVM_MEM_MAX_NR_PAGES) return -EINVAL; and so that maximum "size" will ever be is 0x7fffffff000. The sum of the two is, however, problematic. While the size is restricted by KVM's memslot logic, the offset is not, i.e. the offset is completely unchecked until the "offset + size > i_size_read(inode)" check. If the offset is the (nearly) largest possible _positive_ value, then adding size to the offset can result in a signed, negative 64-bit value. When compared against the size of the file (guaranteed to be positive), the negative sum is always smaller, and KVM incorrectly allows the absurd offset. Opportunistically add missing includes in kvm_mm.h (instead of relying on its parents).
Title KVM: guest_memfd: Treat memslot binding offset+size as unsigned values
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-07-25T08:49:25.642Z

Reserved: 2026-07-19T15:36:31.777Z

Link: CVE-2026-64283

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Analyzed

Published: 2026-07-25T10:17:08.910

Modified: 2026-08-13T15:36:20.733

Link: CVE-2026-64283

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-07-25T00:00:00Z

Links: CVE-2026-64283 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T19:30:04Z

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound