BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org
Cc: daniel@iogearbox.net, martin.lau@linux.dev, kernel-team@fb.com,
	yonghong.song@linux.dev, eddyz87@gmail.com
Subject: [PATCH bpf-next 0/3] bpf: consolidate pointer offset tracking in var_off
Date: Wed, 11 Feb 2026 14:31:37 -0800	[thread overview]
Message-ID: <20260211-ptrs-off-migration-v1-0-996c2a37b063@gmail.com> (raw)

Consolidate static and varying pointer offset tracking logic in the
BPF verifier. All pointer offsets are now represented solely using
`reg->var_off` and min/max fields, simplifying pointer tracking code
and making it easier to widen pointer registers for loop convergence
checks.

Patch 1 is a preparatory refactoring of check_reg_sane_offset().
Patch 2 is the main change, moving pointer offsets from `reg->off`
  to `reg->var_off`.
Patch 3 renames the now-repurposed `reg->off` field to `reg->delta`,
  reflecting its remaining role as a constant delta between linked
  scalar registers.

---
Eduard Zingerman (3):
      bpf: split check_reg_sane_offset() in two parts
      bpf: use reg->var_off instead of reg->off for pointers
      bpf: rename bpf_reg_state->off to bpf_reg_state->delta

 include/linux/bpf_verifier.h                       |   5 +-
 kernel/bpf/log.c                                   |  10 +-
 kernel/bpf/verifier.c                              | 363 +++++++++------------
 .../testing/selftests/bpf/prog_tests/linked_list.c |   4 +-
 .../selftests/bpf/progs/exceptions_assert.c        |   2 +-
 tools/testing/selftests/bpf/progs/iters.c          |   6 +-
 .../selftests/bpf/progs/mem_rdonly_untrusted.c     |   2 +-
 tools/testing/selftests/bpf/progs/verifier_align.c |  40 +--
 .../testing/selftests/bpf/progs/verifier_bounds.c  |   2 +-
 .../bpf/progs/verifier_direct_packet_access.c      |   4 +-
 tools/testing/selftests/bpf/progs/verifier_gotox.c |   4 +-
 .../bpf/progs/verifier_helper_packet_access.c      |   2 +-
 .../bpf/progs/verifier_helper_value_access.c       |   4 +-
 .../testing/selftests/bpf/progs/verifier_int_ptr.c |   2 +-
 .../selftests/bpf/progs/verifier_meta_access.c     |   2 +-
 .../selftests/bpf/progs/verifier_spill_fill.c      |   8 +-
 .../selftests/bpf/progs/verifier_stack_ptr.c       |   4 +-
 .../selftests/bpf/progs/verifier_value_ptr_arith.c |  10 +-
 .../bpf/progs/verifier_xdp_direct_packet_access.c  |  64 ++--
 tools/testing/selftests/bpf/verifier/calls.c       |   2 +-
 20 files changed, 235 insertions(+), 305 deletions(-)
---
base-commit: 4475cdac12c46fc26ee815de1b43cfe9f8375140
change-id: 20260211-ptrs-off-migration-9ad00d0c3f93

             reply	other threads:[~2026-02-11 22:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 22:31 Eduard Zingerman [this message]
2026-02-11 22:31 ` [PATCH bpf-next 1/3] bpf: split check_reg_sane_offset() in two parts Eduard Zingerman
2026-02-11 22:31 ` [PATCH bpf-next 2/3] bpf: use reg->var_off instead of reg->off for pointers Eduard Zingerman
2026-02-12  2:23   ` Alexei Starovoitov
2026-02-12  5:06     ` Eduard Zingerman
2026-02-11 22:31 ` [PATCH bpf-next 3/3] bpf: rename bpf_reg_state->off to bpf_reg_state->delta Eduard Zingerman
2026-02-11 23:08   ` bot+bpf-ci
2026-02-11 23:14     ` Eduard Zingerman
2026-02-12  3:06   ` kernel test robot
2026-02-12  8:15   ` kernel test robot
2026-02-12  8:15   ` kernel test robot

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=20260211-ptrs-off-migration-v1-0-996c2a37b063@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@linux.dev \
    --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