CVE-2025-37893

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

State
Published
Severity
7.8 High
Published
Apr 18, 2025
Updated
Aug 5, 2026
Reserved
Apr 16, 2025

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux
3.15.5 MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HCISA-ADP

Weaknesses

Affected Products

ProductVersions
LinuxLinux
  • 5dc615520c4dfb358245680f1904bad61116648e to before b3ffad2f02db4aace6799fe0049508b8925eae45Affected
  • 5dc615520c4dfb358245680f1904bad61116648e to before 205a2182c51ffebaef54d643e3745e720cded08bAffected
  • 5dc615520c4dfb358245680f1904bad61116648e to before c74d95a5679741ef428974ab788f5b0758dc78aeAffected
  • 5dc615520c4dfb358245680f1904bad61116648e to before 48b904de2408af5f936f0e03f48dfcddeab58aa0Affected
  • 5dc615520c4dfb358245680f1904bad61116648e to before 7e2586991e36663c9bc48c828b83eab180ad30a9Affected
LinuxLinux
  • 6.1Affected
  • before 6.1Not affected
  • 6.6.87 through 6.6.*Not affected
  • 6.12.23 through 6.12.*Not affected
  • 6.13.11 through 6.13.*Not affected
  • 6.14.2 through 6.14.*Not affected
  • 6.15 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.