{"id":"CVE-2026-143321","summary":"bpf: Don't trust pointers spilled in slots that a callee can write","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Don't trust pointers spilled in slots that a callee can write\n\narg_track follows pointers to the stack through registers and spills.\nScalar evolution and the removal of dead slots rely on it to know which\nslots an insn reads and writes.\n\narg_track assumes that a call does not change the pointers that are spilled\nin the frame of the caller. But a static subprog or a callback can store\na pointer to other memory there, and the caller can use it:\n\n  *(u64 *)(r10 - 16) = fp-8\n  r1 = fp-16, r2 = map_value\n  call sub                        ; *(u64 *)(r1 + 0) = r2\n  r7 = *(u64 *)(r10 - 16)         ; verifier: map_value. arg_track: fp-8\n  *(u64 *)(r10 - 8) = fp-24\n  *(u64 *)(r7 + 0) = 0            ; arg_track: fp-8 is overwritten\n  r8 = *(u64 *)(r10 - 8)          ; verifier: fp-24. arg_track: none\n  loop:\n    r1 = *(u64 *)(r10 - 24)       ; the counter of the loop\n    ...\n    *(u64 *)(r8 + 0) = 4096       ; arg_track: not a write to fp-24\n\nScalar evolution does not see the last store. It gives the counter the\nrange of a loop that only increments it. The prog loads, and it accesses\na map value out of bounds.\n\nValid progs are rejected as well. The store through r7 makes fp-8 dead, and\na later read of fp-8 fails with \"slot poisoned by dead code elimination\".\n\nWhen a static subprog or a callback can get a pointer to the frame of its\ncaller, join every slot of that frame with \"not a pointer to the stack\".\nReads and possible writes through a filled pointer are still seen, but no\nstore through it is a certain write. It has to be every slot: the callee\nreaches the whole frame from one pointer, and callees are analyzed after\nthe caller. The price is precision: an 8-byte load through a filled\npointer gives a value that can point to any frame.\n\nFor a spilled copy of r10 this needs \"bpf: Fix the join of fp+0 with\na value that is not a pointer to stack\".\n\nIn selftests, Cilium and sched_ext the stack marks change in 4 of 12522\nprogs. Verdicts, insns and states do not change in any prog.\n\none_fp_clear_stack_threshold and two_fp_clear_stack_threshold expect the\nfake offset fp+0 in the log now.","modified":"2026-12-03T11:01:49.720705180Z","published":"2026-12-03T09:21:49.088Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143321.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/6420b2a5fc52ed075bf9ac3841ba4a073a2be1b9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/cdefba74b53fb9b482355ebde1654800aea45dae"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143321.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143321"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"bf0c571f7feb6fa05a512e2a5e50702501849d61"},{"fixed":"6420b2a5fc52ed075bf9ac3841ba4a073a2be1b9"},{"fixed":"cdefba74b53fb9b482355ebde1654800aea45dae"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143321.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"7.1.0"},{"fixed":"7.3.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143321.json"}}],"schema_version":"1.9.2"}