---
id: "CVE-2026-98639"
kind: "vulnerability"
aliases: ["CVE-2026-98639"]
title: "Linux kernel RISC-V KVM: nested TLB flush ranges can be wrong"
severity: "unknown"
cvss: null
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["kvm", "linux-kernel", "riscv", "runtime", "self-hosted"]
not_affected_if: ["no-kvm", "non-riscv-hardware"]
published_at: "2026-10-18T16:17:17+00:00"
first_seen_at: "2026-10-23T21:57:16+00:00"
updated_at: "2026-10-25T05:20:56+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-98639", "first_seen_at": "2026-10-23T21:57:16+00:00"}]
---

# Linux kernel RISC-V KVM: nested TLB flush ranges can be wrong

On RISC-V hosts running KVM, the kernel wrote the nested HFENCE entry's config word before its page number and count words, so the SBI implementation or hardware could act on stale range values from an earlier use of that entry. The fix writes the parameter words first, then the config word, with memory barriers.

_Summary, check and fix written by a model from the sources; labelled as such._

## Timeline

- 2026-10-23T21:57:16+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-98639

## From the sources

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

KVM: riscv: Fix NACL hfence entry update order

The SBI v3.0 specification (section 15.1.2) requires a nested HFENCE
entry to be populated as follows:
1) find an unused entry with Config.Pending == 0
2) update the Page_Number and Page_Count words
3) update the Config word with Config.Pending set

__kvm_riscv_nacl_hfence() writes the Config word first, so the SBI
implementation (or NACL hardware) can observe a pending entry with
pnum/pcount values left over from the previous use of that entry,
resulting in incorrect TLB flush ranges.

Write pnum and pcount first and the Config word last. Since the
consumer is an external agent on coherent shared memory, use
WRITE_ONCE() to stop the compiler from reordering the stores and
smp_wmb() to make the parameter words globally visible before the
Pending bit is set.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
