{"id":"CVE-2026-139202","state":"PUBLISHED","title":"bpf: Validate stack arg reads against caller state","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Validate stack arg reads against caller state\n\ncheck_stack_arg_read() bounds a stack argument index with the callee's\nBTF-derived argument count, then uses the index in the caller's\nstack_arg_regs[] array. The array's actual logical length is recorded in\ncaller->out_stack_arg_cnt, so the bound and indexed object can diverge.\n\nA crafted BPF_PROG_LOAD can use an argument mismatch to mark a static\nsubprogram's BTF information unreliable. Later calls return from\nbtf_check_subprog_call() before check_outgoing_stack_args(), while\ncheck_func_call() continues the static call on -EINVAL. The callee can\nthen read a slot that the caller never allocated or initialized. The\nearlier commit 4286f5deee14 (\"bpf: Validate outgoing stack args when\nbtf_prepare_func_args fails\") closed this hole for the first call, but\nnot for later calls after the subprogram has been marked unreliable.\n\nCallbacks have a related problem. The verifier can make incoming stack\narguments readable from outgoing slots at the helper call site. However,\nhelpers and kfuncs invoke callbacks through an ABI that passes at most five\narguments, so the runtime callback receives no stack arguments. Async\ncallback verification can also reach check_stack_arg_read() without a\ncaller frame.\n\nOn x86-64, KASAN reports the direct-call out-of-bounds copy as:\n\n  BUG: KASAN: slab-out-of-bounds in check_load_mem+0xb51/0xc60\n  Read of size 80 at addr ffff8881009af550 by task poc/131\n  Call Trace:\n   check_stack_arg_read at kernel/bpf/verifier.c:4234\n   (inlined by) check_load_mem at kernel/bpf/verifier.c:6645\n   do_check_common at kernel/bpf/verifier.c:19568\n   bpf_check at kernel/bpf/verifier.c:21318\n   bpf_prog_load at kernel/bpf/syscall.c:3134\n\nReject callback subprograms with incoming stack arguments before their\nstate is pushed. For direct calls, retrieve the slot with\nbpf_get_spilled_stack_arg(), which validates the index against the caller's\nout_stack_arg_cnt and rejects uninitialized slots before copying the\nregister state.","publishedAt":"2026-11-30T13:32:31.434Z","updatedAt":"2026-11-30T13:32:31.434Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0f6bd5e7a804af27e7f34b8306afde7a6b269318","status":"affected","lessThan":"2baf358407edb426fc3c6d90e1df9ee9f88f8e07","versionType":"git"},{"version":"0f6bd5e7a804af27e7f34b8306afde7a6b269318","status":"affected","lessThan":"90aedf8854c05713c02b381c41c59081b5cedbcc","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.2","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"]}],"references":["https://git.kernel.org/stable/c/2baf358407edb426fc3c6d90e1df9ee9f88f8e07","https://git.kernel.org/stable/c/90aedf8854c05713c02b381c41c59081b5cedbcc"],"weaknesses":[],"ingestedAt":"2026-11-30T13:44:05.999Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139202.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139202","state":"PUBLISHED","datePublished":"2026-11-30T13:32:31.434Z","dateUpdated":"2026-11-30T13:32:31.434Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.920Z"},"containers":{"cna":{"title":"bpf: Validate stack arg reads against caller state","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Validate stack arg reads against caller state\n\ncheck_stack_arg_read() bounds a stack argument index with the callee's\nBTF-derived argument count, then uses the index in the caller's\nstack_arg_regs[] array. The array's actual logical length is recorded in\ncaller->out_stack_arg_cnt, so the bound and indexed object can diverge.\n\nA crafted BPF_PROG_LOAD can use an argument mismatch to mark a static\nsubprogram's BTF information unreliable. Later calls return from\nbtf_check_subprog_call() before check_outgoing_stack_args(), while\ncheck_func_call() continues the static call on -EINVAL. The callee can\nthen read a slot that the caller never allocated or initialized. The\nearlier commit 4286f5deee14 (\"bpf: Validate outgoing stack args when\nbtf_prepare_func_args fails\") closed this hole for the first call, but\nnot for later calls after the subprogram has been marked unreliable.\n\nCallbacks have a related problem. The verifier can make incoming stack\narguments readable from outgoing slots at the helper call site. However,\nhelpers and kfuncs invoke callbacks through an ABI that passes at most five\narguments, so the runtime callback receives no stack arguments. Async\ncallback verification can also reach check_stack_arg_read() without a\ncaller frame.\n\nOn x86-64, KASAN reports the direct-call out-of-bounds copy as:\n\n  BUG: KASAN: slab-out-of-bounds in check_load_mem+0xb51/0xc60\n  Read of size 80 at addr ffff8881009af550 by task poc/131\n  Call Trace:\n   check_stack_arg_read at kernel/bpf/verifier.c:4234\n   (inlined by) check_load_mem at kernel/bpf/verifier.c:6645\n   do_check_common at kernel/bpf/verifier.c:19568\n   bpf_check at kernel/bpf/verifier.c:21318\n   bpf_prog_load at kernel/bpf/syscall.c:3134\n\nReject callback subprograms with incoming stack arguments before their\nstate is pushed. For direct calls, retrieve the slot with\nbpf_get_spilled_stack_arg(), which validates the index against the caller's\nout_stack_arg_cnt and rejects uninitialized slots before copying the\nregister state."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0f6bd5e7a804af27e7f34b8306afde7a6b269318","status":"affected","lessThan":"2baf358407edb426fc3c6d90e1df9ee9f88f8e07","versionType":"git"},{"version":"0f6bd5e7a804af27e7f34b8306afde7a6b269318","status":"affected","lessThan":"90aedf8854c05713c02b381c41c59081b5cedbcc","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.2","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/2baf358407edb426fc3c6d90e1df9ee9f88f8e07"},{"url":"https://git.kernel.org/stable/c/90aedf8854c05713c02b381c41c59081b5cedbcc"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:32:31.434Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.2","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.2","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}