# CVE-2025-40065: RISC-V: KVM: Write hgatp register with valid mode bits

- 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.24%, higher than 15% of CVEs (2026-12-01)
- Published: 2025-10-28T11:48:35.785Z
- Modified: 2026-10-30T13:18:12.777Z
- Assigned by: Linux

## Description

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

RISC-V: KVM: Write hgatp register with valid mode bits

According to the RISC-V Privileged Architecture Spec, when MODE=Bare
is selected,software must write zero to the remaining fields of hgatp.

We have detected the valid mode supported by the HW before, So using a
valid mode to detect how many vmid bits are supported.

(As written by CVE List.)

## Affected

- Linux Linux: from fd7bb4a251dfc1da3496bf59a4793937c13e8c1f before feb64ca53d97b3ac8ba9ecbeae5f9426f1513650; from fd7bb4a251dfc1da3496bf59a4793937c13e8c1f before 8b6e327736db013b9e385c3f6f9f0b04ddf26e43; from fd7bb4a251dfc1da3496bf59a4793937c13e8c1f before 5cba8ae00279296a586d0596443109d601b1d116; from fd7bb4a251dfc1da3496bf59a4793937c13e8c1f before d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357; from fd7bb4a251dfc1da3496bf59a4793937c13e8c1f before 2b351e3d04be9e1533f26c3464f1e44a5beace30; 5.16 (not affected: before 5.16; from 6.1.191 up to 6.1.*; from 6.6.160 up to 6.6.*; from 6.12.114 up to 6.12.*; from 6.17.3 up to 6.17.*; from 6.18 up to *)

## References

- <https://git.kernel.org/stable/c/feb64ca53d97b3ac8ba9ecbeae5f9426f1513650>
- <https://git.kernel.org/stable/c/8b6e327736db013b9e385c3f6f9f0b04ddf26e43>
- <https://git.kernel.org/stable/c/5cba8ae00279296a586d0596443109d601b1d116>
- <https://git.kernel.org/stable/c/d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357>
- <https://git.kernel.org/stable/c/2b351e3d04be9e1533f26c3464f1e44a5beace30>

## Sources

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

---

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