In the Linux kernel, the following vulnerability has been resolved:
bpf: Do not include stack ptr register in precision backtracking bookkeeping
Yi Lai reported an issue ([1]) where the following warning appears in kernel dmesg: [ 60.643604] verifier backtracking bug [ 60.643635] WARNING: CPU: 10 PID: 2315 at kernel/bpf/verifier.c:4302 markchainprecision+0x3a6c/0x3e10 [ 60.648428] Modules linked in: bpftestmod(OE) [ 60.650471] CPU: 10 UID: 0 PID: 2315 Comm: testprogs Tainted: G OE 6.15.0-rc4-gef11287f8289-dirty #327 PREEMPT(full) [ 60.654385] Tainted: [O]=OOTMODULE, [E]=UNSIGNEDMODULE [ 60.656682] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 60.660475] RIP: 0010:markchainprecision+0x3a6c/0x3e10 [ 60.662814] Code: 5a 30 84 89 ea e8 c4 d9 01 00 80 3d 3e 7d d8 04 00 0f 85 60 fa ff ff c6 05 31 7d d8 04 01 48 c7 c7 00 58 30 84 e8 c4 06 a5 ff <0f> 0b e9 46 fa ff ff 48 ... [ 60.668720] RSP: 0018:ffff888116cc7298 EFLAGS: 00010246 [ 60.671075] RAX: 54d70e82dfd31900 RBX: ffff888115b65e20 RCX: 0000000000000000 [ 60.673659] RDX: 0000000000000001 RSI: 0000000000000004 RDI: 00000000ffffffff [ 60.676241] RBP: 0000000000000400 R08: ffff8881f6f23bd3 R09: 1ffff1103ede477a [ 60.678787] R10: dffffc0000000000 R11: ffffed103ede477b R12: ffff888115b60ae8 [ 60.681420] R13: 1ffff11022b6cbc4 R14: 00000000fffffff2 R15: 0000000000000001 [ 60.684030] FS: 00007fc2aedd80c0(0000) GS:ffff88826fa8a000(0000) knlGS:0000000000000000 [ 60.686837] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 60.689027] CR2: 000056325369e000 CR3: 000000011088b002 CR4: 0000000000370ef0 [ 60.691623] Call Trace: [ 60.692821] <TASK> [ 60.693960] ? _pfxverbose+0x10/0x10 [ 60.695656] ? _pfxdisasmkfuncname+0x10/0x10 [ 60.697495] checkcondjmpop+0x16f7/0x39b0 [ 60.699237] docheck+0x58fa/0xab10 ...
Further analysis shows the warning is at line 4302 as below:
4294 /* static subprog call instruction, which 4295 * means that we are exiting current subprog, 4296 * so only r1-r5 could be still requested as 4297 * precise, r0 and r6-r10 or any stack slot in 4298 * the current frame should be zero by now 4299 */ 4300 if (btregmask(bt) & ~BPFREGMASKARGS) { 4301 verbose(env, "BUG regs %x\n", btregmask(bt)); 4302 WARN_ONCE(1, "verifier backtracking bug"); 4303 return -EFAULT; 4304 }
With the below test (also in the next patch): _used _naked static void _bpfjmpr10(void) { asm volatile ( "r2 = 2314885393468386424 ll;" "goto +0;" "if r2 <= r10 goto +3;" "if r1 >= -1835016 goto +0;" "if r2 <= 8 goto +0;" "if r3 <= 0 goto +0;" "exit;" ::: _clobber_all); }
SEC("?rawtp") _naked void bpfjmpr10(void) { asm volatile ( "r3 = 0 ll;" "call _bpfjmpr10;" "r0 = 0;" "exit;" ::: _clobber_all); }
The following is the verifier failure log: 0: (18) r3 = 0x0 ; R3w=0 2: (85) call pc+2 caller: R10=fp0 callee: frame1: R1=ctx() R3w=0 R10=fp0 5: frame1: R1=ctx() R3w=0 R10=fp0 ; asm volatile (" \ @ verifierprecision.c:184 5: (18) r2 = 0x20202000256c6c78 ; frame1: R2w=0x20202000256c6c78 7: (05) goto pc+0 8: (bd) if r2 <= r10 goto pc+3 ; frame1: R2w=0x20202000256c6c78 R10=fp0 9: (35) if r1 >= 0xffe3fff8 goto pc+0 ; frame1: R1=ctx() 10: (b5) if r2 <= 0x8 goto pc+0 markprecise: frame1: lastidx 10 firstidx 0 subseqidx -1 markprecise: frame1: regs=r2 stack= before 9: (35) if r1 >= 0xffe3fff8 goto pc+0 markprecise: frame1: regs=r2 stack= before 8: (bd) if r2 <= r10 goto pc+3 mark_preci ---truncated---
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ac49b7560b4b08b1e4043a29214cc7ad77644c00",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "check_cond_jmp_op",
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-05acd988",
"digest": {
"length": 5114.0,
"function_hash": "298249389478879969425617511330501618675"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4265682c29c92f52c0da6fad5a79b5801462c8de",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-0cd495d3",
"digest": {
"threshold": 0.9,
"line_hashes": [
"155330875249822535387727168239993749269",
"210492114651125652048233451595574075559",
"117828042921354368946740546604274879230",
"136848478461664026132921033391918962872",
"236820428534456871783733088851363870685",
"275225361636879428059243976716905869708",
"238059111962341596855619306376605126233",
"24474902354289799394818069457524970906",
"60348668338203315906843932886538463036",
"52368118652280015563543703453239821407",
"202712980170528210193428428254046712303",
"88669153082287100016447215210707656435",
"108370434437350458341533716098920738271",
"154306752631762623153797315049362411005",
"270003211417612031862961554506561652577",
"247011502538364447118881420049135815396"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e2d2115e56c4a02377189bfc3a9a7933552a7b0f",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "include/linux/bpf_verifier.h"
},
"id": "CVE-2025-38279-0fb3f28b",
"digest": {
"threshold": 0.9,
"line_hashes": [
"223628627672751672104136552955462674369",
"76707228284769280772307157748143675359",
"3428409499166637939455043870201784547",
"113331454795366517033680453295979995556",
"18639454858999565239497375109315594898",
"8123371719799501174699448528528519243",
"263957596696596900580849397953698603917",
"325812094768388946315691515246826899990",
"164799147561907241538604818214193171716"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4265682c29c92f52c0da6fad5a79b5801462c8de",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "include/linux/bpf_verifier.h"
},
"id": "CVE-2025-38279-13b01b5d",
"digest": {
"threshold": 0.9,
"line_hashes": [
"223628627672751672104136552955462674369",
"76707228284769280772307157748143675359",
"3428409499166637939455043870201784547",
"113331454795366517033680453295979995556",
"18639454858999565239497375109315594898",
"8123371719799501174699448528528519243",
"263957596696596900580849397953698603917",
"325812094768388946315691515246826899990",
"164799147561907241538604818214193171716"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e2d2115e56c4a02377189bfc3a9a7933552a7b0f",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "check_cond_jmp_op",
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-22d5a9cb",
"digest": {
"length": 5114.0,
"function_hash": "298249389478879969425617511330501618675"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e2d2115e56c4a02377189bfc3a9a7933552a7b0f",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "backtrack_insn",
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-55a8b380",
"digest": {
"length": 4764.0,
"function_hash": "41030132438131561121862359638673572560"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e2d2115e56c4a02377189bfc3a9a7933552a7b0f",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-5b24b893",
"digest": {
"threshold": 0.9,
"line_hashes": [
"155330875249822535387727168239993749269",
"210492114651125652048233451595574075559",
"117828042921354368946740546604274879230",
"136848478461664026132921033391918962872",
"236820428534456871783733088851363870685",
"275225361636879428059243976716905869708",
"238059111962341596855619306376605126233",
"24474902354289799394818069457524970906",
"60348668338203315906843932886538463036",
"52368118652280015563543703453239821407",
"202712980170528210193428428254046712303",
"88669153082287100016447215210707656435",
"108370434437350458341533716098920738271",
"154306752631762623153797315049362411005",
"270003211417612031862961554506561652577",
"247011502538364447118881420049135815396"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ac49b7560b4b08b1e4043a29214cc7ad77644c00",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-723871e2",
"digest": {
"threshold": 0.9,
"line_hashes": [
"155330875249822535387727168239993749269",
"210492114651125652048233451595574075559",
"117828042921354368946740546604274879230",
"136848478461664026132921033391918962872",
"236820428534456871783733088851363870685",
"275225361636879428059243976716905869708",
"238059111962341596855619306376605126233",
"24474902354289799394818069457524970906",
"60348668338203315906843932886538463036",
"52368118652280015563543703453239821407",
"202712980170528210193428428254046712303",
"88669153082287100016447215210707656435",
"108370434437350458341533716098920738271",
"154306752631762623153797315049362411005",
"270003211417612031862961554506561652577",
"247011502538364447118881420049135815396"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ac49b7560b4b08b1e4043a29214cc7ad77644c00",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "backtrack_insn",
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-8364af6e",
"digest": {
"length": 5020.0,
"function_hash": "214243366966999096533333130027835574069"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4265682c29c92f52c0da6fad5a79b5801462c8de",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "check_cond_jmp_op",
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-b787e46e",
"digest": {
"length": 5190.0,
"function_hash": "66072356253804163748339631805299748522"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4265682c29c92f52c0da6fad5a79b5801462c8de",
"signature_version": "v1",
"deprecated": false,
"target": {
"function": "backtrack_insn",
"file": "kernel/bpf/verifier.c"
},
"id": "CVE-2025-38279-e6170248",
"digest": {
"length": 5121.0,
"function_hash": "19262372230992799877502323575551605064"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ac49b7560b4b08b1e4043a29214cc7ad77644c00",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "include/linux/bpf_verifier.h"
},
"id": "CVE-2025-38279-ea7c9e77",
"digest": {
"threshold": 0.9,
"line_hashes": [
"223628627672751672104136552955462674369",
"76707228284769280772307157748143675359",
"3428409499166637939455043870201784547",
"113331454795366517033680453295979995556",
"18639454858999565239497375109315594898",
"8123371719799501174699448528528519243",
"263957596696596900580849397953698603917",
"325812094768388946315691515246826899990",
"164799147561907241538604818214193171716"
]
},
"signature_type": "Line"
}
]