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 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.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.12.23, 6.13.11, 6.14.2, 6.6.87
- CVEs
- CVE-2025-37893
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 11:57 UTC · Revision 1
Source evidence
LoongArch: BPF: Fix off-by-one error in build_prologue()
core-osv · Original sourcePublished 18 Apr 2025, 07:01 UTC
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.
osv:CVE-2025-37893
Kernel
Fixed versions: 6.6.87, 6.12.23, 6.13.11, 6.14.2
Complete source record
{
"id": "2a2396d7a5719bd745ad6f1c80ec2972a44c589f0b9ba4fae65d70518a21b547",
"url": "https://osv.dev/vulnerability/CVE-2025-37893",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "LoongArch: BPF: Fix off-by-one error in build_prologue()",
"summary": "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.",
"evidence": "osv:CVE-2025-37893",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.6.87",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.23",
"evidence": "/affected/1/ranges"
},
{
"value": "6.13.11",
"evidence": "/affected/1/ranges"
},
{
"value": "6.14.2",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2025-37893",
"aliases": [
"CVE-2025-37893"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "5dc615520c4dfb358245680f1904bad61116648e"
},
{
"fixed": "b3ffad2f02db4aace6799fe0049508b8925eae45"
},
{
"fixed": "205a2182c51ffebaef54d643e3745e720cded08b"
},
{
"fixed": "c74d95a5679741ef428974ab788f5b0758dc78ae"
},
{
"fixed": "48b904de2408af5f936f0e03f48dfcddeab58aa0"
},
{
"fixed": "7e2586991e36663c9bc48c828b83eab180ad30a9"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-37893.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.1.0"
},
{
"fixed": "6.6.87"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.23"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.13.11"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.14.0"
},
{
"fixed": "6.14.2"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-37893.json"
}
}
],
"modified": "2026-10-28T02:30:35.302036789Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/205a2182c51ffebaef54d643e3745e720cded08b",
"https://git.kernel.org/stable/c/48b904de2408af5f936f0e03f48dfcddeab58aa0",
"https://git.kernel.org/stable/c/7e2586991e36663c9bc48c828b83eab180ad30a9",
"https://git.kernel.org/stable/c/b3ffad2f02db4aace6799fe0049508b8925eae45",
"https://git.kernel.org/stable/c/c74d95a5679741ef428974ab788f5b0758dc78ae",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/37xxx/CVE-2025-37893.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-37893",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/37xxx/CVE-2025-37893.json"
}
},
"related_cves": [
{
"value": "CVE-2025-37893",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 502208,
"published_at": "2025-04-18T07:01:28.856+00:00"
}