Skip to main content
Vulnerability Database/CVE-2026-98639

CVE-2026-98639: Linux Kernel KVM RISC-V Privilege Escalation

CVE-2026-98639 is a privilege escalation vulnerability in Linux kernel KVM RISC-V affecting NACL hfence entry update ordering. This flaw can lead to incorrect TLB flush ranges. This article covers technical details, affected versions, security impact, and mitigation strategies.

Published:

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-98639 Overview

CVE-2026-98639 is a Linux kernel vulnerability in the RISC-V Kernel-based Virtual Machine (KVM) subsystem. The flaw affects the Nested Acceleration (NACL) HFENCE entry update sequence in __kvm_riscv_nacl_hfence(). The function writes the Config word before populating the Page_Number and Page_Count fields, violating the ordering required by the SBI v3.0 specification (section 15.1.2). As a result, the Supervisor Binary Interface (SBI) implementation or NACL hardware can observe a pending HFENCE entry containing stale page number and count values from previous use. The incorrect data leads to wrong Translation Lookaside Buffer (TLB) flush ranges in nested virtualization scenarios.

Critical Impact

Incorrect TLB flush ranges in RISC-V nested virtualization can produce stale address translations, risking guest memory consistency and VM isolation integrity.

Affected Products

  • Linux kernel RISC-V KVM subsystem
  • Systems using SBI v3.0 Nested Acceleration (NACL) extension
  • RISC-V hosts running nested virtualization workloads

Discovery Timeline

  • 2026-10-18 - CVE-2026-98639 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98639

Vulnerability Analysis

The vulnerability resides in the RISC-V KVM NACL HFENCE handling code. HFENCE instructions flush TLB entries related to hypervisor-managed guest address translations. When NACL offloads these fences through shared memory entries, the SBI specification requires strict ordering: locate an unused entry with Config.Pending == 0, populate the parameter words, then set the Config word with the Pending bit.

The existing __kvm_riscv_nacl_hfence() implementation reverses that order. It writes the Config word first, which can expose a pending entry whose pnum and pcount fields still hold values from the previous flush. External consumers reading the shared memory region observe inconsistent state and flush incorrect address ranges.

Root Cause

The root cause is incorrect store ordering combined with insufficient memory barriers between the host and an external coherent consumer. The compiler is free to reorder plain stores, and the architectural write ordering does not guarantee visibility to an external agent without an explicit write memory barrier. Setting the Pending bit before the parameter words creates a window where downstream TLB flush operations use stale metadata.

Attack Vector

Exploitation requires executing nested virtualization workloads on RISC-V hosts with NACL enabled. A guest that triggers HFENCE operations can trigger stale-parameter flushes, producing TLB inconsistency between the host and guest views of memory. The resulting translation anomalies may corrupt guest state or weaken isolation between nested VMs. The condition manifests from legitimate kernel code paths; no attacker-controlled payload is required beyond stressing the HFENCE path.

The fix reorders the stores so pnum and pcount are written first using WRITE_ONCE() to prevent compiler reordering, followed by smp_wmb() to establish global visibility, and finally the Config word with the Pending bit set. See the upstream commits in the Linux kernel stable tree for the complete patch.

Detection Methods for CVE-2026-98639

Indicators of Compromise

  • Unexpected guest memory corruption or page fault patterns on RISC-V KVM hosts running nested VMs with NACL enabled
  • Kernel log anomalies referencing HFENCE operations or TLB flush inconsistencies in the KVM RISC-V subsystem
  • Guest kernel panics or stale translation errors following HFENCE-heavy workloads

Detection Strategies

  • Inventory RISC-V hosts running the Linux kernel and identify those compiled with KVM and SBI NACL support
  • Compare installed kernel versions and commit hashes against the fixed commits 6da4665, b3d3468, and d6de766
  • Monitor virtualization telemetry for guest instability correlated with heavy TLB maintenance activity

Monitoring Recommendations

  • Collect kernel logs from RISC-V KVM hosts and route them to a centralized logging platform for anomaly review
  • Track kernel build metadata across the fleet to confirm patched versions are deployed
  • Baseline nested VM stability metrics so regressions tied to HFENCE pathways become visible

How to Mitigate CVE-2026-98639

Immediate Actions Required

  • Apply the upstream Linux kernel patches referenced in the stable tree commits 6da4665, b3d3468, and d6de766
  • Prioritize RISC-V hosts running nested virtualization with NACL enabled when scheduling kernel updates
  • Rebuild and redeploy custom RISC-V kernels after cherry-picking the fix into vendor branches

Patch Information

The fix changes the store order in __kvm_riscv_nacl_hfence() to write pnum and pcount first, insert an smp_wmb() barrier, and then write the Config word with the Pending bit. WRITE_ONCE() is used to prevent compiler reordering of the stores. Patches are available in the Linux stable kernel tree at commits 6da4665, b3d3468, and d6de766.

Workarounds

  • Disable the SBI NACL extension on affected RISC-V hosts if the firmware supports configuration overrides
  • Avoid running nested virtualization workloads on unpatched RISC-V KVM hosts until kernels are updated
  • Pin workloads sensitive to translation consistency to non-RISC-V hosts during the remediation window

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.