bpf, riscv: Fix extable handling for arena load_acquire
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 |
|
|
6.18.527.2.67.3In the Linux kernel, the following vulnerability has been resolved:
bpf, riscv: Fix extable handling for arena load_acquire
emit_atomic_ld_st() returns 1 to have build_body() skip the zext after a sub-word load_acquire. The caller does "ret = ret ?: add_exception_handler(...)", which skips add_exception_handler() on any non-zero ret, so the extable entry is missing and a faulting PROBE_ATOMIC load_acquire oopses.
REG_DONT_CLEAR_MARKER leaves rd stale on fault, and the verifier still thinks the load overwrote it, so a program can leak it through a map.
Check ret >= 0 before calling add_exception_handler(), and pass rd for LOAD_ACQ so the fault zeroes rd like a PROBE_MEM load. Return ret unchanged for the zext skip.
From the CVE record · Linux
The Linux kernel’s RISC-V BPF handling can miss an exception-table entry for a faulting PROBE_ATOMIC load_acquire. A program that triggers this fault can cause a kernel oops and leak a stale register value through a map. The input does not specify authentication or user-interaction requirements.
Engineers running the Linux kernel on RISC-V should check their deployments; affected versions are not specified.