{"id":"CVE-2026-143367","state":"PUBLISHED","title":"bpf, x86: Fix bpf_throw() in a prog with a private stack","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, x86: Fix bpf_throw() in a prog with a private stack\n\nWhen the main prog has a private stack and the prog calls bpf_throw(), it\nreturns to the kernel with wrong values in r12, rbx, r13, r14 and r15. The\nkernel crashes soon after that, for example:\n\n  BUG: kernel NULL pointer dereference, address: 0000000000000010\n  RIP: 0010:__bpf_prog_test_run_raw_tp+0x125/0x380\n\nThe main prog of a prog that can throw saves these five registers at its\nentry. bpf_throw() walks the stack to the frame of the main prog and\ngives the stack pointer of that frame to the exception callback, which\npops the registers from there. In a function with a private stack r9 is\nthe frame pointer, and the JIT emits 'push r9' in front of every call\nand 'pop r9' after it. So the stack pointer that bpf_throw() finds is\n8 bytes too low:\n\n  r12\n  rbx\n  r13\n  r14\n  r15  <- the callback has to pop from here\n  r9   <- rsp of the main prog at the call\n\nr15 gets the address of the private stack and every other register gets\nthe value of its neighbour.\n\nThis happens in tracepoint, raw_tp, perf_event and tracing progs, except\niterators, and in struct_ops progs that ask for a private stack, when\nthe main prog has more than 48 bytes of stack. The throw can be in the\nmain prog or in a subprog.\n\naux->stack_arg_sp_adjust already moves the stack pointer from the\noutgoing stack arguments up to the saved registers. Add the 8 bytes of\nr9 to it when the main prog has a private stack.\n\nA constant is enough. Calls of helpers, kfuncs and subprogs and callx\nall have the push. A prog with tail calls has no private stack, and a\ncallback cannot throw. Only the frame of the main prog matters: the\nframes of subprogs are dropped, with or without a private stack. On\nx86-64 a function with stack arguments has no private stack, hence only\none of the two parts is not zero.\n\nThe JITed code does not change.","publishedAt":"2026-12-03T09:22:18.763Z","updatedAt":"2026-12-03T09:22:18.763Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7d1cd70d4b16ff0216a5f6c2ae7d0fa9fa978c07","status":"affected","lessThan":"66b2255211e67e4c7a4fc625566f90763fb6b966","versionType":"git"},{"version":"7d1cd70d4b16ff0216a5f6c2ae7d0fa9fa978c07","status":"affected","lessThan":"91068ed2d3ee0713d7566c7977b995f8a0936bea","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/net/bpf_jit_comp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.13","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.13","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/net/bpf_jit_comp.c"]}],"references":["https://git.kernel.org/stable/c/66b2255211e67e4c7a4fc625566f90763fb6b966","https://git.kernel.org/stable/c/91068ed2d3ee0713d7566c7977b995f8a0936bea"],"weaknesses":[],"ingestedAt":"2026-12-03T09:44:04.436Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143367.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143367","state":"PUBLISHED","datePublished":"2026-12-03T09:22:18.763Z","dateUpdated":"2026-12-03T09:22:18.763Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.371Z"},"containers":{"cna":{"title":"bpf, x86: Fix bpf_throw() in a prog with a private stack","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, x86: Fix bpf_throw() in a prog with a private stack\n\nWhen the main prog has a private stack and the prog calls bpf_throw(), it\nreturns to the kernel with wrong values in r12, rbx, r13, r14 and r15. The\nkernel crashes soon after that, for example:\n\n  BUG: kernel NULL pointer dereference, address: 0000000000000010\n  RIP: 0010:__bpf_prog_test_run_raw_tp+0x125/0x380\n\nThe main prog of a prog that can throw saves these five registers at its\nentry. bpf_throw() walks the stack to the frame of the main prog and\ngives the stack pointer of that frame to the exception callback, which\npops the registers from there. In a function with a private stack r9 is\nthe frame pointer, and the JIT emits 'push r9' in front of every call\nand 'pop r9' after it. So the stack pointer that bpf_throw() finds is\n8 bytes too low:\n\n  r12\n  rbx\n  r13\n  r14\n  r15  <- the callback has to pop from here\n  r9   <- rsp of the main prog at the call\n\nr15 gets the address of the private stack and every other register gets\nthe value of its neighbour.\n\nThis happens in tracepoint, raw_tp, perf_event and tracing progs, except\niterators, and in struct_ops progs that ask for a private stack, when\nthe main prog has more than 48 bytes of stack. The throw can be in the\nmain prog or in a subprog.\n\naux->stack_arg_sp_adjust already moves the stack pointer from the\noutgoing stack arguments up to the saved registers. Add the 8 bytes of\nr9 to it when the main prog has a private stack.\n\nA constant is enough. Calls of helpers, kfuncs and subprogs and callx\nall have the push. A prog with tail calls has no private stack, and a\ncallback cannot throw. Only the frame of the main prog matters: the\nframes of subprogs are dropped, with or without a private stack. On\nx86-64 a function with stack arguments has no private stack, hence only\none of the two parts is not zero.\n\nThe JITed code does not change."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7d1cd70d4b16ff0216a5f6c2ae7d0fa9fa978c07","status":"affected","lessThan":"66b2255211e67e4c7a4fc625566f90763fb6b966","versionType":"git"},{"version":"7d1cd70d4b16ff0216a5f6c2ae7d0fa9fa978c07","status":"affected","lessThan":"91068ed2d3ee0713d7566c7977b995f8a0936bea","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/net/bpf_jit_comp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.13","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.13","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/net/bpf_jit_comp.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/66b2255211e67e4c7a4fc625566f90763fb6b966"},{"url":"https://git.kernel.org/stable/c/91068ed2d3ee0713d7566c7977b995f8a0936bea"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:22:18.763Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.13","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.13","versionEndExcluding":"7.4-rc2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}