riscv: uprobes: Add missing fence.i after building the XOL buffer
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 74784081aac8a0f3636965fc230e2d3b7cc123c6 · < 7d1d19a11cfbfd8bae1d89cc010b2cc397cd0c48| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
riscv: uprobes: Add missing fence.i after building the XOL buffer
The XOL (execute out-of-line) buffer is used to single-step the replaced instruction(s) for uprobes. The RISC-V port was missing a proper fence.i (i$ flushing) after constructing the XOL buffer, which can result in incorrect execution of stale/broken instructions.
This was found running the BPF selftests "test_progs: uprobe_autoattach, attach_probe" on the Spacemit K1/X60, where the uprobes tests randomly blew up.
From the CVE record · Linux
The RISC-V uprobes code in the Linux kernel does not flush the instruction cache after building its execute-out-of-line (XOL) buffer. When uprobes single-step instructions from that buffer, stale or broken instructions may execute. The input does not describe an attacker path or specify authentication or user-interaction requirements.
Engineers running the Linux kernel on RISC-V systems with uprobes should check their deployments; affected versions are not specified.