Linux kernel uninitialized data use in RISC-V ptrace regsets
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
7.2.117.3In the Linux kernel, the following vulnerability has been resolved:
riscv: ptrace: Zero-initialize regset buffers before copyin
user_regset_copyin() only copies `count` bytes, so a PTRACE_SETREGSET request with a short iov_len leaves the rest of the stack buffer uninitialized. In riscv_vr_set() that garbage is validated and copied into the target's vstate, and in riscv_cfi_set() it can be stored as the target's shadow stack pointer. Zero both buffers, as the get path already does.
From the CVE record · Linux
The Linux kernel’s RISC-V ptrace handlers leave part of a stack buffer uninitialized when a PTRACE_SETREGSET request supplies a short iov_len. A local caller able to make that request can cause uninitialized data to be validated and copied into a target’s vector state or stored as its shadow stack pointer. No separate user interaction is described.
Engineers running Linux kernels on RISC-V should check their kernels; affected versions are not specified.