riscv, bpf: Fix kernel stack corruption in tailcall with CFI
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.12
|
In the Linux kernel, the following vulnerability has been resolved:
riscv, bpf: Fix kernel stack corruption in tailcall with CFI
When CONFIG_CFI_CLANG is enabled, prog->bpf_func already skips the kcfi instruction during setup. Including it again in the tailcall jump offset causes it to jump over an extra 4 bytes, skipping the stack pointer adjustment, which will result in kernel stack corruption.
From the CVE record · Linux
When CONFIG_CFI_CLANG is enabled, an incorrect RISC-V BPF tailcall jump offset can skip a stack-pointer adjustment, causing kernel stack corruption. The input does not specify how an attacker could trigger it or whether authentication or user interaction is required.
Teams running the Linux kernel on RISC-V with CONFIG_CFI_CLANG enabled should check their systems; affected versions are not specified.