In the Linux kernel, the following vulnerability has been resolved:
LoongArch: BPF: Fix jump offset calculation in tailcall
The extra pass of bpfintjitcompile() skips JIT context initialization which essentially skips offset calculation leaving outoffset = -1, so the jmpoffset in emitbpftailcall is calculated by
"#define jmpoffset (outoffset - (cur_offset))"
is a negative number, which is wrong. The final generated assembly are as follow.
54: bgeu $a2, $t1, -8 # 0x0000004c 58: addi.d $a6, $s5, -1 5c: bltz $a6, -16 # 0x0000004c 60: alsl.d $t2, $a2, $a1, 0x3 64: ld.d $t2, $t2, 264 68: beq $t2, $zero, -28 # 0x0000004c
Before apply this patch, the follow test case will reveal soft lock issues.
cd tools/testing/selftests/bpf/ ./testprogs --allow=tailcalls/tailcallbpf2bpf_1
dmesg: watchdog: BUG: soft lockup - CPU#2 stuck for 26s! [test_progs:25056]
[
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"241918539155888064674267418325946152487",
"27623836629324130967697185855290602149",
"36082226743910044135360027195759037447",
"180368973274885450596148484745203323311",
"184438273854616014095546788737391583051",
"56236786984905616241822484355778039223",
"121822058385309247611481538856302171764",
"258622763724227865740262250476896877955",
"158669300321310511323167069182072792721",
"255624331042450861013699233160908005310",
"55943080808049156638300765573697567921",
"325806962316063596878697147800038442119",
"168995696438279499837882702829815086638",
"102489806320040633301897159029710252249",
"24070915576175972051345482049865935743",
"58601955751293678806910825626137531783",
"310013153137958115240211958166911729404",
"311809852199050346840451067626341611955",
"225283922673991446421275707741463738029",
"87450943866160093608141494285935465654",
"157767224558220386231644911265633271440",
"116998501907567589983366743892097768543",
"138697662855508207062361698258899740727",
"181356965977578295187165331294286176714",
"20640850212991142756597653449662096882",
"303066529738926562258864311132943755254",
"60330375367689501031598593109390778039",
"25488196546480466555327481170809903904"
]
},
"id": "CVE-2025-38723-2f9d0fae",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f83d469e16bb1f75991ca67c56786fb2aaa42bea",
"target": {
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"241918539155888064674267418325946152487",
"27623836629324130967697185855290602149",
"36082226743910044135360027195759037447",
"180368973274885450596148484745203323311",
"184438273854616014095546788737391583051",
"56236786984905616241822484355778039223",
"121822058385309247611481538856302171764",
"258622763724227865740262250476896877955",
"158669300321310511323167069182072792721",
"255624331042450861013699233160908005310",
"55943080808049156638300765573697567921",
"325806962316063596878697147800038442119",
"168995696438279499837882702829815086638",
"102489806320040633301897159029710252249",
"24070915576175972051345482049865935743",
"58601955751293678806910825626137531783",
"310013153137958115240211958166911729404",
"311809852199050346840451067626341611955",
"225283922673991446421275707741463738029",
"87450943866160093608141494285935465654",
"157767224558220386231644911265633271440",
"116998501907567589983366743892097768543",
"138697662855508207062361698258899740727",
"181356965977578295187165331294286176714",
"20640850212991142756597653449662096882",
"303066529738926562258864311132943755254",
"60330375367689501031598593109390778039",
"25488196546480466555327481170809903904"
]
},
"id": "CVE-2025-38723-3202fded",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cd39d9e6b7e4c58fa77783e7aedf7ada51d02ea3",
"target": {
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "118278255554371825267153487392239021922",
"length": 15829.0
},
"id": "CVE-2025-38723-38af3f39",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f83d469e16bb1f75991ca67c56786fb2aaa42bea",
"target": {
"function": "build_insn",
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "175379204490756836125263486437277757128",
"length": 2735.0
},
"id": "CVE-2025-38723-52f6e314",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f83d469e16bb1f75991ca67c56786fb2aaa42bea",
"target": {
"function": "bpf_int_jit_compile",
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"241918539155888064674267418325946152487",
"27623836629324130967697185855290602149",
"36082226743910044135360027195759037447",
"180368973274885450596148484745203323311",
"184438273854616014095546788737391583051",
"56236786984905616241822484355778039223",
"121822058385309247611481538856302171764",
"258622763724227865740262250476896877955",
"158669300321310511323167069182072792721",
"255624331042450861013699233160908005310",
"55943080808049156638300765573697567921",
"325806962316063596878697147800038442119",
"168995696438279499837882702829815086638",
"102489806320040633301897159029710252249",
"24070915576175972051345482049865935743",
"58601955751293678806910825626137531783",
"310013153137958115240211958166911729404",
"311809852199050346840451067626341611955",
"225283922673991446421275707741463738029",
"87450943866160093608141494285935465654",
"157767224558220386231644911265633271440",
"116998501907567589983366743892097768543",
"138697662855508207062361698258899740727",
"181356965977578295187165331294286176714",
"20640850212991142756597653449662096882",
"303066529738926562258864311132943755254",
"179898912002883231807499566968567407725",
"198188337431661858583372518290295875411"
]
},
"id": "CVE-2025-38723-5e4fea12",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17c010fe45def335fe03a0718935416b04c7f349",
"target": {
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "193712342559257359843992318915822879756",
"length": 2597.0
},
"id": "CVE-2025-38723-aae12d4f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17c010fe45def335fe03a0718935416b04c7f349",
"target": {
"function": "bpf_int_jit_compile",
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "315187623072560436990859591618414744923",
"length": 1260.0
},
"id": "CVE-2025-38723-b43240fd",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f83d469e16bb1f75991ca67c56786fb2aaa42bea",
"target": {
"function": "emit_bpf_tail_call",
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "226859899954257416189691568005179152384",
"length": 13869.0
},
"id": "CVE-2025-38723-b792e778",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17c010fe45def335fe03a0718935416b04c7f349",
"target": {
"function": "build_insn",
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "118278255554371825267153487392239021922",
"length": 15829.0
},
"id": "CVE-2025-38723-be956108",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cd39d9e6b7e4c58fa77783e7aedf7ada51d02ea3",
"target": {
"function": "build_insn",
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "175379204490756836125263486437277757128",
"length": 2735.0
},
"id": "CVE-2025-38723-c44b678a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cd39d9e6b7e4c58fa77783e7aedf7ada51d02ea3",
"target": {
"function": "bpf_int_jit_compile",
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "315187623072560436990859591618414744923",
"length": 1260.0
},
"id": "CVE-2025-38723-d6935a6c",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cd39d9e6b7e4c58fa77783e7aedf7ada51d02ea3",
"target": {
"function": "emit_bpf_tail_call",
"file": "arch/loongarch/net/bpf_jit.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "315187623072560436990859591618414744923",
"length": 1260.0
},
"id": "CVE-2025-38723-d927b980",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17c010fe45def335fe03a0718935416b04c7f349",
"target": {
"function": "emit_bpf_tail_call",
"file": "arch/loongarch/net/bpf_jit.c"
}
}
]