Executive brief
A memory leak vulnerability was identified in the Linux kernel's RISC-V virtualization component (KVM). This issue occurs when the system fails to properly clean up memory during the setup of virtual machine resources, potentially leading to a gradual depletion of system memory. While difficult to exploit, it could theoretically be used by a local user to cause system instability or performance degradation over time.
Technical details
A memory leak exists in arch/riscv/kvm/vcpu_vector.c within the kvm_riscv_vcpu_alloc_vector_context function. The function performs two sequential kzalloc calls to allocate memory for guest and host vector contexts. If the second allocation (host_context.vector.datap) fails, the function returns -ENOMEM without freeing the memory previously allocated for guest_context.vector.datap. This is a local vulnerability requiring the ability to trigger VCPU vector context allocations. The fix involves explicitly calling kfree on the first allocation if the second one fails.
Affected products
- Linux Linux Kernel RISC-V architecture with KVM enabled
Timeline
- 2026-03-16: other: Patch authored
- 2026-05-14: patched: Patch committed to stable tree
- 2026-05-28: advisory: CVE published by NVD