Linux Kernel KVM Guest Memory File Binding Vulnerability Leading to Use-After-Free

Vulnerability

A use-after-free vulnerability has been identified in the Linux kernel's KVM (Kernel-based Virtual Machine) module, specifically within the guest memory file handling. This issue arises when a memory slot is unbound from a guest-specific memory file (guest_memfd) while the file is in the process of being released. The vulnerability occurs because the unbinding process can nullify the memory slot reference before the file is fully closed, leading to a write operation on freed memory. This flaw was detected by syzbot, a kernel fuzzer, in the stable branch of the Linux kernel.

Impact

Exploitation of this vulnerability causes a use-after-free condition, where the system attempts to access memory that has already been freed, potentially leading to arbitrary code execution or other serious consequences.

Reproduction

The vulnerability can be reproduced by creating a KVM virtual machine and using the KVM_CREATE_GUEST_MEMFD ioctl to attach a guest memory file. Then, unbind a memory slot from the guest_memfd while the file is still being closed. This can be done by manually managing the lifecycle of the memory slots and guest memory files, ensuring that the unbinding occurs before the file is fully released.

Remediation

Users can upgrade to the latest stable version of the Linux kernel, where this vulnerability has been fixed. Instructions for upgrading the kernel can be found in the official Linux kernel documentation.

Added: Dec 6, 2025, 10:44 PM
Updated: Dec 6, 2025, 10:44 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
2.5
exploitability
3.4
remediation
7.7
relevance
1.4
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.