# CVE-2025-37893: LoongArch: BPF: Fix off-by-one error in build_prologue()

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.29%, higher than 22% of CVEs (2026-12-01)
- Published: 2025-04-18T07:01:28.856Z
- Modified: 2026-08-05T11:58:07.979Z
- Weaknesses: CWE-193
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

LoongArch: BPF: Fix off-by-one error in build_prologue()

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, build_prologue() generates N insns in the
first pass and then generates N+1 insns in the second pass. This makes
epilogue_offset off by one and we will jump to some unexpected insn and
cause lockup. Fix this by inserting a nop insn.

(As written by CVE List.)

## Affected

- Linux Linux: from 5dc615520c4dfb358245680f1904bad61116648e before b3ffad2f02db4aace6799fe0049508b8925eae45; from 5dc615520c4dfb358245680f1904bad61116648e before 205a2182c51ffebaef54d643e3745e720cded08b; from 5dc615520c4dfb358245680f1904bad61116648e before c74d95a5679741ef428974ab788f5b0758dc78ae; from 5dc615520c4dfb358245680f1904bad61116648e before 48b904de2408af5f936f0e03f48dfcddeab58aa0; from 5dc615520c4dfb358245680f1904bad61116648e before 7e2586991e36663c9bc48c828b83eab180ad30a9; 6.1 (not affected: before 6.1; from 6.6.87 up to 6.6.*; from 6.12.23 up to 6.12.*; from 6.13.11 up to 6.13.*; from 6.14.2 up to 6.14.*; from 6.15 up to *)
- linux linux_kernel: from 6.1 before 6.1.134; from 6.2 before 6.6.87; from 6.7 before 6.12.23; from 6.13 before 6.13.11; from 6.14 before 6.14.2

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- CISA-ADP: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/b3ffad2f02db4aace6799fe0049508b8925eae45> (patch)
- <https://git.kernel.org/stable/c/205a2182c51ffebaef54d643e3745e720cded08b> (patch)
- <https://git.kernel.org/stable/c/c74d95a5679741ef428974ab788f5b0758dc78ae> (patch)
- <https://git.kernel.org/stable/c/48b904de2408af5f936f0e03f48dfcddeab58aa0> (patch)
- <https://git.kernel.org/stable/c/7e2586991e36663c9bc48c828b83eab180ad30a9> (patch)

## Sources

- CVE List: [CVE-2025-37893](https://www.cve.org/CVERecord?id=CVE-2025-37893), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2025-37893](https://nvd.nist.gov/vuln/detail/CVE-2025-37893), Public domain, modified 2026-07-30

---

Page: https://cve.day/CVE-2025-37893 · Whole record: https://cve.day/CVE-2025-37893.json · Rebuilt by cve.day 2026-11-25T22:58:56.755Z
