{"id":"CVE-2026-143367","summary":"bpf, x86: Fix bpf_throw() in a prog with a private stack","details":"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  \u003c- the callback has to pop from here\n  r9   \u003c- 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-\u003estack_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.","modified":"2026-12-03T11:02:07.609279969Z","published":"2026-12-03T09:22:18.763Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143367.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/66b2255211e67e4c7a4fc625566f90763fb6b966"},{"type":"WEB","url":"https://git.kernel.org/stable/c/91068ed2d3ee0713d7566c7977b995f8a0936bea"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143367.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143367"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"7d1cd70d4b16ff0216a5f6c2ae7d0fa9fa978c07"},{"fixed":"66b2255211e67e4c7a4fc625566f90763fb6b966"},{"fixed":"91068ed2d3ee0713d7566c7977b995f8a0936bea"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143367.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"7.3.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143367.json"}}],"schema_version":"1.9.2"}