CVE-2026-139628: bpf: Adjust bpf_func to account for CFI offset in bpf_jit_free on riscv
bpf: Adjust bpffunc to account for CFI offset in bpfjitfree on riscv
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.119 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.6-1 - Compensating control
In bpf_jit_free() on riscv, subtract cfi_get_offset() from prog->bpf_func to restore the original JITed allocation address before freeing it.
Event History
Frequently Asked Questions
Which systems are affected by this issue?
The issue applies to Linux kernel systems on RISC-V where CFI is enabled and BPF JIT-compiled programs are freed. The CFI preamble shifts the BPF program entry point from the original JIT allocation address.
What occurs during the vulnerable cleanup path?
During bpf_jit_free(), the shifted BPF function pointer can be used to retrieve the wrong ro_header, which can result in an invalid memory free. The fix restores the original allocation address by subtracting cfi_get_offset() from prog->bpf_func before freeing it.