From: patchwork-bot+netdevbpf@kernel.org
To: Eduard Zingerman <eddyz87@gmail.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
daniel@iogearbox.net, martin.lau@linux.dev, kernel-team@fb.com,
yonghong.song@linux.dev, memxor@gmail.com, npc@anthropic.com
Subject: Re: [PATCH bpf 1/8] bpf: don't infer non-NULL from a pointer with an unbounded offset
Date: Fri, 04 Sep 2026 11:10:15 +0000 [thread overview]
Message-ID: <178852021565.200410.13716301907669096570.git-patchwork-notify@kernel.org> (raw)
In-Reply-To: <20260904083325.2083493-1-eddyz87@gmail.com>
Hello:
This series was applied to bpf/bpf.git (master)
by Kumar Kartikeya Dwivedi <memxor@gmail.com>:
On Fri, 4 Sep 2026 01:33:18 -0700 you wrote:
> reg_not_null() decides that a register holds a non-NULL value by
> looking at its type alone. For pointer types that allow arithmetic the
> type only guarantees a non-NULL base, in case of an unbound offset
> the runtime offset value might still add up to NULL.
> Consider the followng program:
>
> r6 = bpf_map_lookup_elem(map, &0); /* present */
> if (r6 == 0) return 0;
> r7 = bpf_map_lookup_elem(map, &1); /* absent, NULL at runtime */
> r8 = r7;
> r8 -= r6; /* pointer - pointer: unknown scalar, -r6 */
> r8 <<= 1;
> r8 >>= 1; /* any non-negative offset is accepted by */
> /* check_reg_sane_offset_ptr() */
> r6 += r8; /* verifier: map value; runtime: zero */
> if (r7 != r6) return 0;
> *(u8 *)(r7 + 0); /* r7 is inferred non-NULL, both are zero */
>
> [...]
Here is the summary with links:
- [bpf,1/8] bpf: don't infer non-NULL from a pointer with an unbounded offset
https://git.kernel.org/bpf/bpf/c/67b529f521a6
- [bpf,2/8] selftests/bpf: no non-NULL inference from unbounded offset pointers
https://git.kernel.org/bpf/bpf/c/6752b90ccfb3
- [bpf,3/8] bpf: don't resurrect a scalar id dropped by collect_linked_regs()
https://git.kernel.org/bpf/bpf/c/73a98f96811e
- [bpf,4/8] selftests/bpf: check the linked regs cap for the compared register
https://git.kernel.org/bpf/bpf/c/bc412b3fb185
- [bpf,5/8] bpf: don't predict JMP32 pointer vs zero comparisons
https://git.kernel.org/bpf/bpf/c/e51179a4e098
- [bpf,6/8] selftests/bpf: check that JMP32 pointer vs zero jumps are not predicted
https://git.kernel.org/bpf/bpf/c/836b2fe544a5
- [bpf,7/8] bpf: mark the zero register precise for a register-form NULL check
https://git.kernel.org/bpf/bpf/c/6aed0134d3cd
- [bpf,8/8] selftests/bpf: no non-NULL inference from an imprecise zero register
https://git.kernel.org/bpf/bpf/c/6b31560c6bc1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
prev parent reply other threads:[~2026-09-04 11:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 8:33 [PATCH bpf 1/8] bpf: don't infer non-NULL from a pointer with an unbounded offset Eduard Zingerman
2026-09-04 8:33 ` [PATCH bpf 2/8] selftests/bpf: no non-NULL inference from unbounded offset pointers Eduard Zingerman
2026-09-04 8:33 ` [PATCH bpf 3/8] bpf: don't resurrect a scalar id dropped by collect_linked_regs() Eduard Zingerman
2026-09-04 8:33 ` [PATCH bpf 4/8] selftests/bpf: check the linked regs cap for the compared register Eduard Zingerman
2026-09-04 8:33 ` [PATCH bpf 5/8] bpf: don't predict JMP32 pointer vs zero comparisons Eduard Zingerman
2026-09-04 8:33 ` [PATCH bpf 6/8] selftests/bpf: check that JMP32 pointer vs zero jumps are not predicted Eduard Zingerman
2026-09-04 8:33 ` [PATCH bpf 7/8] bpf: mark the zero register precise for a register-form NULL check Eduard Zingerman
2026-09-04 8:57 ` sashiko-bot
2026-09-04 11:11 ` Kumar Kartikeya Dwivedi
2026-09-04 8:33 ` [PATCH bpf 8/8] selftests/bpf: no non-NULL inference from an imprecise zero register Eduard Zingerman
2026-09-04 11:10 ` patchwork-bot+netdevbpf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178852021565.200410.13716301907669096570.git-patchwork-notify@kernel.org \
--to=patchwork-bot+netdevbpf@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@fb.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=npc@anthropic.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox