Skip to contentSkip to conversation

CVE-2026-46171: riscv: kvm: fix vector context allocation leak

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 28

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

riscv: kvm: fix vector context allocation leak

When the second kzalloc (host_context.vector.datap) fails in kvm_riscv_vcpu_alloc_vector_context, the first allocation (guest_context.vector.datap) is leaked. Free it before returning.

The Linux kernel CVE team has assigned CVE-2026-46171 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.5 with commit 0f4b82579716b12bb88257bd7ea80f25c791fb2c and fixed in 6.18.30 with commit bd62c0f61bc722a097417401030c596cea8e21aa
	Issue introduced in 6.5 with commit 0f4b82579716b12bb88257bd7ea80f25c791fb2c and fixed in 7.0.7 with commit 1d57ab45ec5c0e22789de793bcf2a31ad6fb7d98
	Issue introduced in 6.5 with commit 0f4b82579716b12bb88257bd7ea80f25c791fb2c and fixed in 7.1-rc1 with commit b7c958d7c1eb1cb9b2be7b5ee4129fcd66cec978

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-46171

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
arch/riscv/kvm/vcpu_vector.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/bd62c0f61bc722a097417401030c596cea8e21aa
	https://git.kernel.org/stable/c/1d57ab45ec5c0e22789de793bcf2a31ad6fb7d98
	https://git.kernel.org/stable/c/b7c958d7c1eb1cb9b2be7b5ee4129fcd66cec978