Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98464 Overview
CVE-2026-98464 is a use-after-free vulnerability in the Linux kernel's RISC-V Kernel-based Virtual Machine (KVM) subsystem. The flaw lives in the non-Sstc high-resolution timer (hrtimer) callback path used for virtual CPU (vCPU) timer emulation. The callback clears the next_set flag before completing its final references to the enclosing vCPU structure. If teardown observes next_set as false while the callback still runs, kvm_riscv_vcpu_timer_cancel() skips hrtimer_cancel(), and kvm_destroy_vcpus() can free the vCPU before the callback enters kvm_riscv_vcpu_set_interrupt(). A guest can trigger the race by arming the timer with Supervisor Binary Interface (SBI) TIME and requesting shutdown through SBI legacy shutdown or SRST.
Critical Impact
A malicious guest on a RISC-V host can race vCPU teardown to trigger a slab use-after-free in host kernel memory, enabling potential host denial of service or memory corruption.
Affected Products
- Linux kernel RISC-V KVM subsystem (non-Sstc timer path)
- Upstream master at commit 62cc90241548 confirmed vulnerable
- Stable kernel branches receiving backport commits listed in references
Discovery Timeline
- 2026-10-18 - CVE-2026-98464 published to the National Vulnerability Database (NVD)
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-98464
Vulnerability Analysis
The vulnerability is a race condition between the RISC-V KVM hrtimer callback and vCPU teardown [CWE-416: Use After Free]. The non-Sstc timer path in kvm_riscv_vcpu_hrtimer_expired() clears the next_set state flag before it has finished dereferencing the vCPU. The teardown path in kvm_riscv_vcpu_timer_cancel() checks next_set to decide whether to call hrtimer_cancel(). When the callback has already cleared the flag but has not yet returned, teardown skips cancellation and proceeds to free the vCPU through kvm_destroy_vcpus().
The still-running callback then calls kvm_riscv_vcpu_set_interrupt() on freed memory. Kernel Address Sanitizer (KASAN) observed the resulting slab-use-after-free on a 4-byte write at the vCPU interrupt lock, with the stack trace running from hrtimer_interrupt through __hrtimer_run_queues into kvm_riscv_vcpu_set_interrupt and do_raw_spin_lock. Reproduction is timing-sensitive; the reporter widened the window with an inserted mdelay(1000) to produce deterministic failures.
Root Cause
The cancel-side check uses next_set as a proxy for "callback is not running," but the callback itself clears that flag early. There is no synchronization barrier between the clear and the final vCPU access, so teardown can race ahead of callback completion and free the object the callback still holds.
Attack Vector
A guest arms the vCPU timer using SBI TIME and then requests shutdown via SBI legacy shutdown or SRST. A Virtual Machine Monitor (VMM) that honors KVM_EXIT_SYSTEM_EVENT destroys the VM, supplying the teardown half of the race. No post-launch host ioctl is required to arm the timer or trigger teardown, so the attack surface is reachable from an unprivileged guest kernel.
See the upstream fix commits for the exact patch logic that forces hrtimer_cancel() on an initialized timer and synchronizes with any running callback before returning -EINVAL.
Detection Methods for CVE-2026-98464
Indicators of Compromise
- KASAN reports of slab-use-after-free with call stacks containing kvm_riscv_vcpu_set_interrupt, kvm_riscv_vcpu_hrtimer_expired, __hrtimer_run_queues, and hrtimer_interrupt.
- Host kernel oops or panic logs on RISC-V hypervisors shortly after guest shutdown or KVM_EXIT_SYSTEM_EVENT handling.
- Unexpected spin-lock corruption traces referencing freed vCPU slab objects.
Detection Strategies
- Enable KASAN on RISC-V test hosts to surface the race during VM lifecycle fuzzing.
- Correlate guest-initiated SBI shutdown or SRST events with host dmesg entries containing kvm_riscv symbols.
- Monitor hypervisor hosts for repeated VM destroy events paired with kernel warnings in the hrtimer subsystem.
Monitoring Recommendations
- Forward host kernel logs from RISC-V hypervisors into a centralized logging or SIEM pipeline and alert on KASAN, BUG:, and general protection fault strings.
- Track VMM crash and restart telemetry on multi-tenant RISC-V hosts as a secondary signal for triggered races.
- Baseline normal guest shutdown behavior to detect bursts of SBI legacy shutdown or SRST calls from a single tenant.
How to Mitigate CVE-2026-98464
Immediate Actions Required
- Apply the upstream fix commits to all RISC-V hosts running KVM workloads; prioritize multi-tenant hypervisors.
- Rebuild and reboot RISC-V hypervisor kernels after patching to ensure the corrected teardown path is loaded.
- Restrict guest provisioning on unpatched RISC-V hosts to trusted workloads until the fix is deployed.
Patch Information
The fix always invokes hrtimer_cancel() for an initialized timer and preserves the existing -EINVAL result when the timer is no longer set, but only after synchronizing with a running callback. Upstream fix commits are available in the kernel.org stable tree: commit 2af03b606aad, commit 3cc6184bd592, commit 9bdbae64ae0d, commit aaad136d56d9, commit e66aced74f01, and commit ea91f05a55b8.
Workarounds
- Disable KVM on affected RISC-V hosts if virtualization is not required.
- Where supported, enable Sstc timer extensions so the vulnerable non-Sstc hrtimer callback path is not exercised.
- Avoid honoring guest-initiated KVM_EXIT_SYSTEM_EVENT destroy flows on unpatched hosts until kernels can be updated.
# Verify running RISC-V kernel version and KVM module status
uname -r
lsmod | grep kvm
# Rebuild kernel from a patched stable branch, then reboot
# (apply one of the upstream fix commits referenced above)
make -j"$(nproc)" && make modules_install && make install
reboot
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

