CVE-2026-64283 in Linuxinfo

Summary

by MITRE • 07/25/2026

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).

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 07/25/2026

This vulnerability exists within the Linux kernel's KVM subsystem where improper handling of memory slot binding operations can lead to incorrect overflow checks during guest memory file descriptor management. The flaw specifically affects how KVM processes memslot binding offset and size values when creating guest_memfd files, creating a potential security risk through false negative overflow detection. When these values are treated as signed loff_t types instead of unsigned uoff_t types, the arithmetic operations can produce unexpected results that bypass intended safety mechanisms.

The technical implementation issue stems from the conversion of unsigned 64-bit values to signed loff_t types during memory slot operations. On 64-bit kernels, KVM operates with unsigned 64-bit page counts for memslot sizes and offsets, yet the kernel's handling converts these values to signed types. This conversion becomes problematic when performing arithmetic operations like offset + size, where large positive unsigned values can overflow into negative signed results. The vulnerability manifests because the sum of offset and size may be interpreted as a negative value even though both operands are positive, causing incorrect validation logic to pass invalid memory configurations.

The operational impact of this vulnerability extends beyond simple arithmetic errors to potentially enable memory corruption or privilege escalation scenarios within virtualized environments. Since KVM manages guest memory mappings through these memslot bindings, an attacker could exploit the unsigned-to-signed conversion issue to create invalid memory mappings that bypass legitimate size and offset validation checks. This creates opportunities for memory access violations or data corruption that could affect guest operating systems or even host system stability. The vulnerability particularly affects systems using large memory configurations where offsets approach maximum positive values.

The fix addresses this by explicitly treating offset and size values as unsigned types during memslot binding operations, aligning the implementation with the intended unsigned nature of these values throughout the KVM subsystem. This change eliminates the problematic signed conversion that occurs when performing arithmetic operations on what should remain unsigned values. The solution also includes correcting missing header file includes in kvm_mm.h to ensure proper compilation and consistent behavior across different kernel configurations.

This vulnerability aligns with CWE-191, which addresses integer underflow and overflow issues, and specifically demonstrates the risks associated with improper type handling in memory management systems. From an ATT&CK perspective, this represents a potential privilege escalation vector through kernel memory management flaws, though it requires local access to exploit effectively within virtualized environments. The fix maintains compatibility with existing KVM functionality while strengthening the validation logic against integer overflow scenarios that could be exploited in malicious or error-prone configurations.

Responsible

Linux

Reservation

07/19/2026

Disclosure

07/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00219

KEV

no

Activities

low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!