Linux
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 5dc615520c4dfb358245680f1904bad61116648e, < b3ffad2f02db4aace6799fe0049508b8925eae45
- >= 5dc615520c4dfb358245680f1904bad61116648e, < 205a2182c51ffebaef54d643e3745e720cded08b
- >= 5dc615520c4dfb358245680f1904bad61116648e, < c74d95a5679741ef428974ab788f5b0758dc78ae
- >= 5dc615520c4dfb358245680f1904bad61116648e, < 48b904de2408af5f936f0e03f48dfcddeab58aa0
- >= 5dc615520c4dfb358245680f1904bad61116648e, < 7e2586991e36663c9bc48c828b83eab180ad30a9
Fixed in b3ffad2f02db4aace6799fe0049508b8925eae45, 205a2182c51ffebaef54d643e3745e720cded08b, c74d95a5679741ef428974ab788f5b0758dc78ae, 48b904de2408af5f936f0e03f48dfcddeab58aa0, 7e2586991e36663c9bc48c828b83eab180ad30a9
- 6.1
Fixed in 0, 6.6.87, 6.12.23, 6.13.11, 6.14.2, 6.15
Mitigation
Upgrade Linux to b3ffad2f02db4aace6799fe0049508b8925eae45 or 205a2182c51ffebaef54d643e3745e720cded08b or c74d95a5679741ef428974ab788f5b0758dc78ae or 48b904de2408af5f936f0e03f48dfcddeab58aa0 or 7e2586991e36663c9bc48c828b83eab180ad30a9 or later.
Upgrade Linux to 0 or 6.6.87 or 6.12.23 or 6.13.11 or 6.14.2 or 6.15 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.