{"id":"CVE-2025-39815","state":"PUBLISHED","title":"RISC-V: KVM: fix stack overrun when loading vlenb","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nRISC-V: KVM: fix stack overrun when loading vlenb\n\nThe userspace load can put up to 2048 bits into an xlen bit stack\nbuffer.  We want only xlen bits, so check the size beforehand.","publishedAt":"2025-09-16T13:00:16.250Z","updatedAt":"2026-08-05T12:05:22.677Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2fa290372dfe7dd248b1c16f943f273a3e674f22","status":"affected","lessThan":"c76bf8359188a11f8fd790e5bbd6077894a245cc","versionType":"git"},{"version":"2fa290372dfe7dd248b1c16f943f273a3e674f22","status":"affected","lessThan":"6d28659b692a0212f360f8bd8a58712b339f9aac","versionType":"git"},{"version":"2fa290372dfe7dd248b1c16f943f273a3e674f22","status":"affected","lessThan":"799766208f09f95677a9ab111b93872d414fbad7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/kvm/vcpu_vector.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.45","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.16.5","status":"unaffected","lessThanOrEqual":"6.16.*","versionType":"semver"},{"version":"6.17","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/kvm/vcpu_vector.c"]}],"references":["https://git.kernel.org/stable/c/c76bf8359188a11f8fd790e5bbd6077894a245cc","https://git.kernel.org/stable/c/6d28659b692a0212f360f8bd8a58712b339f9aac","https://git.kernel.org/stable/c/799766208f09f95677a9ab111b93872d414fbad7"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/39xxx/CVE-2025-39815.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-39815","state":"PUBLISHED","datePublished":"2025-09-16T13:00:16.250Z","dateUpdated":"2026-08-05T12:05:22.677Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.138Z"},"containers":{"cna":{"title":"RISC-V: KVM: fix stack overrun when loading vlenb","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nRISC-V: KVM: fix stack overrun when loading vlenb\n\nThe userspace load can put up to 2048 bits into an xlen bit stack\nbuffer.  We want only xlen bits, so check the size beforehand."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2fa290372dfe7dd248b1c16f943f273a3e674f22","status":"affected","lessThan":"c76bf8359188a11f8fd790e5bbd6077894a245cc","versionType":"git"},{"version":"2fa290372dfe7dd248b1c16f943f273a3e674f22","status":"affected","lessThan":"6d28659b692a0212f360f8bd8a58712b339f9aac","versionType":"git"},{"version":"2fa290372dfe7dd248b1c16f943f273a3e674f22","status":"affected","lessThan":"799766208f09f95677a9ab111b93872d414fbad7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/kvm/vcpu_vector.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.45","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.16.5","status":"unaffected","lessThanOrEqual":"6.16.*","versionType":"semver"},{"version":"6.17","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/kvm/vcpu_vector.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/c76bf8359188a11f8fd790e5bbd6077894a245cc"},{"url":"https://git.kernel.org/stable/c/6d28659b692a0212f360f8bd8a58712b339f9aac"},{"url":"https://git.kernel.org/stable/c/799766208f09f95677a9ab111b93872d414fbad7"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The bug is reached only through the KVM_SET_ONE_REG ioctl on a vCPU file descriptor obtained from /dev/kvm, requiring local access to the host. There is no remote or adjacent-network path to kvm_riscv_vcpu_set_reg_vector().\nAC:L - A single deterministic ioctl with a crafted reg->id size field (bits 52-55) triggers the overrun every time, with the attacker choosing both the copy length and the overflowing data. No race, no memory-layout guessing, and no condition outside the attacker's control on an affected RISC-V host with the V extension.\nPR:L - No capable()/CAP_SYS_ADMIN check exists anywhere on the path — only opening /dev/kvm and creating a VM/vCPU, which unprivileged users in the kvm group and sandboxed VMM processes (QEMU, crosvm) routinely have. The confined VMM process itself is the natural attacker here.\nUI:N - The attacking process performs the ioctl entirely on its own; no victim action, mount, or file open is needed.\nS:U - The attacker is host userspace and the corrupted memory is the host kernel stack of its own task — the same security authority, i.e. standard kernel privilege escalation rather than a guest-to-host or IOMMU boundary crossing.\nC:H - The attacker-controlled stack smash overwrites saved registers, frame pointers and return addresses, which is a classic route to control-flow hijack and hence arbitrary kernel memory disclosure. Per kernel scoring guidance, memory corruption leverageable for info disclosure is High.\nI:H - This is an out-of-bounds kernel stack write of up to ~32 KB with fully attacker-chosen contents and length, directly overwriting return addresses and adjacent frames — an arbitrary-write/code-execution primitive.\nA:H - Even without exploitation, overrunning the 16 KB RISC-V kernel stack reliably corrupts the stack canary, return addresses, or the VMAP guard page, producing an immediate kernel panic that any user with /dev/kvm access can trigger at will."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:05:22.677Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.12.45"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.16.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.17"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":5.5,"attackVector":"LOCAL","baseSeverity":"MEDIUM","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"NONE"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-39815","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2026-01-14T18:15:40.818434Z"}}}],"problemTypes":[{"descriptions":[{"lang":"en","type":"CWE","description":"CWE-noinfo Not enough information"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-01-14T18:22:55.580Z"}}]}}}