CVE-2025-37893: LoongArch: BPF: Fix off-by-one error in build_prologue()
In the Linux kernel, the following vulnerability has been resolved:
LoongArch: BPF: Fix off-by-one error in buildprologue()
Vincent reported that running BPF progs with tailcalls on LoongArch causes kernel hard lockup. Debugging the issues shows that the JITed image missing a jirl instruction at the end of the epilogue.
There are two passes in JIT compiling, the first pass set the flags and the second pass generates JIT code based on those flags. With BPF progs mixing bpf2bpf and tailcalls, buildprologue() generates N insns in the first pass and then generates N+1 insns in the second pass. This makes epilogueoffset off by one and we will jump to some unexpected insn and cause lockup. Fix this by inserting a nop insn.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-37893?
CVE-2025-37893 has been classified as a moderate severity vulnerability due to its potential to cause kernel hard locks when running BPF programs.
How do I fix CVE-2025-37893?
To fix CVE-2025-37893, update your Linux kernel to the latest stable version where the vulnerability has been patched.
What does CVE-2025-37893 affect?
CVE-2025-37893 specifically affects the Linux kernel running on the LoongArch architecture.
What kind of issue does CVE-2025-37893 cause?
CVE-2025-37893 causes kernel hard lockups when executing BPF programs with tail calls on the affected architecture.
Who reported the vulnerability CVE-2025-37893?
The vulnerability CVE-2025-37893 was reported by Vincent.