CVE-2025-40065 RISC-V: KVM: Write hgatp register with valid mode bits
A Linux kernel KVM bug on RISC-V systems writes invalid bits to the hgatp register, potentially causing system instability or crashes.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-40065?
CVE-2025-40065 is a vulnerability in Linux, published on 28 Oct 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official 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.
Which versions are affected by CVE-2025-40065?
How do I fix CVE-2025-40065?
Apply the vendor's patch.
Is CVE-2025-40065 being exploited?
There is no known exploitation of CVE-2025-40065 in the wild and no public exploit code.
Sources
Also known as AZL-68924, BELL-CVE-2025-40065, DEBIAN-CVE-2025-40065, GHSA-m7w6-fmw8-2v8x, ROOT-OS-DEBIAN-12-CVE-2025-40065, ROOT-OS-DEBIAN-13-CVE-2025-40065 and 2 more.