From: Harishankar Vishwanathan <harishankar.vishwanathan@gmail.com>
To: ast@kernel.org
Cc: m.shachnai@rutgers.edu, srinivas.narayana@rutgers.edu,
santosh.nagarakatte@rutgers.edu,
Harishankar Vishwanathan <harishankar.vishwanathan@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/2] bpf, verifier: Improve precision of BPF_ADD and BPF_SUB
Date: Mon, 23 Jun 2025 00:03:55 -0400 [thread overview]
Message-ID: <20250623040359.343235-1-harishankar.vishwanathan@gmail.com> (raw)
This patchset improves the precision of BPF_ADD and BPF_SUB range
tracking. It also adds selftests that exercise the cases where precision
improvement occurs, and selftests for the cases where precise bounds
cannot be computed and the output register state values are set to
unbounded.
Changelog:
v3:
* Improve readability in selftests and commit message by using
more readable constants (suggested by Eduard Zingerman).
* Add four new selftests for the cases where precise output register
state bounds cannot be computed in scalar(32)_min_max_add/sub, so the
output register state must be set to unbounded, i.e., [0, U64_MAX]
or [0, U32_MAX].
* Add suggested-by Eduard tag to commit message for changes to
verifier_bounds.c
v2:
* Add clearer example of precision improvement in the commit message for
verifier.c changes.
* Add selftests that exercise the precision improvement to
verifier_bounds.c (suggested by Eduard Zingerman).
v1:
https://lore.kernel.org/bpf/20250610221356.2663491-1-harishankar.vishwanathan@gmail.com/
Harishankar Vishwanathan (2):
bpf, verifier: Improve precision for BPF_ADD and BPF_SUB
selftests/bpf: Add testcases for BPF_ADD and BPF_SUB
kernel/bpf/verifier.c | 76 ++++++---
.../selftests/bpf/progs/verifier_bounds.c | 161 ++++++++++++++++++
2 files changed, 217 insertions(+), 20 deletions(-)
--
2.45.2
next reply other threads:[~2025-06-23 4:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 4:03 Harishankar Vishwanathan [this message]
2025-06-23 4:03 ` [PATCH v3 1/2] bpf, verifier: Improve precision for " Harishankar Vishwanathan
2025-06-24 21:59 ` Eduard Zingerman
2025-06-23 4:03 ` [PATCH v3 2/2] selftests/bpf: Add testcases " Harishankar Vishwanathan
2025-06-24 22:45 ` Eduard Zingerman
2025-06-25 1:50 ` Alexei Starovoitov
2025-06-25 2:00 ` [PATCH v3 0/2] bpf, verifier: Improve precision of " patchwork-bot+netdevbpf
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=20250623040359.343235-1-harishankar.vishwanathan@gmail.com \
--to=harishankar.vishwanathan@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.shachnai@rutgers.edu \
--cc=martin.lau@linux.dev \
--cc=santosh.nagarakatte@rutgers.edu \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=srinivas.narayana@rutgers.edu \
--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
all inboxes | Powered by JetHome®