CVE-2026-64082: riscv: Fix register corruption from uninitialized cregs on error
In the Linux kernel, the following vulnerability has been resolved:
riscv: Fix register corruption from uninitialized cregs on error
compatriscvgprset() calls cregstoregs() unconditionally, even when userregsetcopyin() fails. Since cregs is an uninitialized stack variable, a copyin failure causes uninitialized stack data to be written into the target task's ptregs, corrupting its register state and potentially leaking kernel stack contents.
compatrestoresigcontext() has the same issue: it calls cregstoregs() even when copyfromuser() fails, leading to the same corruption of the signal-returning task's register state on error.
Only call cregstoregs() when the user copy succeeds.
Affected Software
Remediation
Event History
Frequently Asked Questions
What access does an attacker need to trigger this issue?
The CVSS vector indicates local access with low privileges and no user interaction required. Exploitation involves causing a user-space copy operation to fail in affected RISC-V compatibility register-setting or signal-return paths.
What is the impact if the issue is triggered?
A failed copy can cause uninitialized kernel stack data to be written into a task's register state. This can corrupt registers and may leak kernel stack contents, with potential effects on confidentiality, integrity, and availability.
Which systems should be prioritized for remediation?
Prioritize Linux kernel systems running on RISC-V that use the affected compatibility register-setting or signal-return code paths, particularly where unprivileged local users can execute code. The provided data does not identify affected kernel version ranges.
What should be done if patching cannot happen immediately?
Restrict untrusted local access where feasible, since exploitation requires local low-privileged access. Apply the available kernel patch as soon as operationally possible.