ZeroHour

CVE-2026-89513

niche

Integer overflow in Linux kernel RISC-V KVM PMU enables guest-to-host memory corruption

CVSS 3.1
8.8 high
EPSS
Published
()
Modified
AI analysis

The Linux kernel's RISC-V KVM implementation mishandles the SBI PMU EVENT_GET_INFO request by storing a guest-controlled num_events multiplied by the entry size in a 32-bit integer. By supplying num_events = 0x10000001, a guest causes the computed size (0x100000010 bytes) to truncate to 16, so KVM allocates a single-entry array but then loops over the original num_events, producing out-of-bounds reads and writes in host kernel heap memory (demonstrated by a KASAN slab-out-of-bounds report triggered from a nested guest). Because the vulnerability corrupts kernel memory from inside a VM, a malicious or compromised guest on an affected RISC-V hypervisor could escape the VM and compromise the host kernel, consistent with the high CVSS 8.8 rating (confidentiality, integrity, and availability all high with scope change). Only systems running Linux as a RISC-V KVM host are affected; the flaw resides in the arch/riscv KVM PMU code path and requires a guest able to issue SBI PMU ecalls. No public proof of concept exists and the issue is not in the CISA KEV catalog, so exploitation in the wild is not currently known.

What to do: Apply kernel updates containing the upstream fix (which stores the shared-memory size in size_t, rejects multiplication overflow, and uses kvcalloc with GFP_KERNEL_ACCOUNT) to all RISC-V hosts running KVM. Until patched, restrict untrusted and nested guest workloads on RISC-V KVM hosts, since a nested guest was shown to trigger the out-of-bounds access. Monitor dmesg for KASAN slab-out-of-bounds reports in kvm_riscv_vcpu_pmu_event_info as an indicator of attempted exploitation.

Affected
Linux kernel (RISC-V KVM SBI PMU event info handling, kvm_riscv_vcpu_pmu_event_info)
Estimated exposure
nichelikely on the order of low thousands of RISC-V KVM virtualization hosts worldwide (rough estimate) — RISC-V server adoption is still nascent, few deployments run KVM virtualization hosts on it, and hypervisors are generally not internet-exposed — the realistic attack surface is untrusted or nested tenants on those hosts, with no public…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

In the Linux kernel, the following vulnerability has been resolved: RISC-V: KVM: Fix PMU event info array size overflow SBI PMU EVENT_GET_INFO stores guest-controlled num_events * sizeof(*einfo) in a 32-bit integer. On RV64, num_events = 0x10000001 makes 0x100000010 truncate to 16. KVM then allocates one entry but loops over the original num_events, causing out-of-bounds reads and writes. A nested guest triggered: BUG: KASAN: slab-out-of-bounds in kvm_riscv_vcpu_pmu_event_info+0xa4/0x142 Read of size 4 at addr ff600000074d46b0 by task init/1 Call Trace: [ ] kvm_riscv_vcpu_pmu_event_info+0xa4/0x142 [ ] kvm_sbi_ext_pmu_handler+0xca/0x268 [ ] kvm_riscv_vcpu_sbi_ecall+0xec/0x1e6 [ ] kvm_riscv_vcpu_exit+0x48c/0x540 [ ] kvm_arch_vcpu_ioctl_run+0x37e/0xc80 Allocated by task 1: __kmalloc_noprof+0x19e/0x4b0 kvm_riscv_vcpu_pmu_event_info+0x72/0x142 kvm_sbi_ext_pmu_handler+0xca/0x268 kvm_riscv_vcpu_sbi_ecall+0xec/0x1e6 kvm_riscv_vcpu_exit+0x48c/0x540 kvm_arch_vcpu_ioctl_run+0x37e/0xc80 The buggy address is located 0 bytes to the right of allocated 16-byte region [ff600000074d46a0, ff600000074d46b0) Store the shared-memory size in size_t and reject multiplication overflow. Allocate the guest-driven array with GFP_KERNEL_ACCOUNT so it is charged to kmemcg, and use __GFP_NOWARN to suppress allocation failure warnings. Use kvcalloc() to allow vmalloc fallback and an unsigned long loop index to match num_events.

Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

In the news

No ingested article mentions this CVE yet.