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.
[
{
"id": "CVE-2025-40065-08e4bc30",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2b351e3d04be9e1533f26c3464f1e44a5beace30",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "arch/riscv/kvm/vmid.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"243071784373728893547724292080401137715",
"171695944463630887686087566632869066200",
"124986319343225704371822865136873409990",
"92652289191922572875702333028510226491",
"36067299168283784053741751115436072889",
"159775589630410139753387814389787547479",
"257317366934873502016165612450458594864",
"224198234103558933013484663686893809180"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2025-40065-b674eb79",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "kvm_riscv_gstage_vmid_detect",
"file": "arch/riscv/kvm/vmid.c"
},
"digest": {
"function_hash": "88660808286457977521297660770126343955",
"length": 364.0
},
"signature_type": "Function"
},
{
"id": "CVE-2025-40065-ecb346db",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d00b61cd37f4c183ce0edbc9f8ccf6d5430ea357",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "arch/riscv/kvm/vmid.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"243071784373728893547724292080401137715",
"171695944463630887686087566632869066200",
"124986319343225704371822865136873409990",
"92652289191922572875702333028510226491",
"36067299168283784053741751115436072889",
"159775589630410139753387814389787547479",
"257317366934873502016165612450458594864",
"224198234103558933013484663686893809180"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2025-40065-eea7766f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2b351e3d04be9e1533f26c3464f1e44a5beace30",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "kvm_riscv_gstage_vmid_detect",
"file": "arch/riscv/kvm/vmid.c"
},
"digest": {
"function_hash": "88660808286457977521297660770126343955",
"length": 364.0
},
"signature_type": "Function"
}
]