# CVE-2026-98639: KVM: riscv: Fix NACL hfence entry update order

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 6% of CVEs (2026-12-01)
- Published: 2026-10-18T15:20:10.591Z
- Modified: 2026-10-19T10:19:28.133Z
- Assigned by: Linux

## Description

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.

(As written by CVE List.)

## Affected

- Linux Linux: from d466c19cead5904d4d5d92adb2b213b411d3b849 before d6de766d8d26d71b714f548192099112def50a9c; from d466c19cead5904d4d5d92adb2b213b411d3b849 before 6da466502621381fa88a6684290923d25c559266; from d466c19cead5904d4d5d92adb2b213b411d3b849 before b3d346838ec65fac7fd83f5dbcedd13cadfffddb; 6.13 (not affected: before 6.13; from 6.18.55 up to 6.18.*; from 7.2.9 up to 7.2.*; from 7.3 up to *)

## References

- <https://git.kernel.org/stable/c/d6de766d8d26d71b714f548192099112def50a9c>
- <https://git.kernel.org/stable/c/6da466502621381fa88a6684290923d25c559266>
- <https://git.kernel.org/stable/c/b3d346838ec65fac7fd83f5dbcedd13cadfffddb>

## Sources

- CVE List: [CVE-2026-98639](https://www.cve.org/CVERecord?id=CVE-2026-98639), CVE Terms of Use, modified 2026-10-19
- NVD: [CVE-2026-98639](https://nvd.nist.gov/vuln/detail/CVE-2026-98639), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2026-98639 · Whole record: https://cve.day/CVE-2026-98639.json · Rebuilt by cve.day 2026-11-25T22:59:45.253Z
