From: sashiko-bot@kernel.org
To: "Nuiqi Gui" <gnq25@mails.tsinghua.edu.cn>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf 2/2] selftests/bpf: add tests for PTR_TO_FLOW_KEYS constant offset bounds
Date: Thu, 04 Jun 2026 15:45:07 +0000 [thread overview]
Message-ID: <20260604154507.B5CB51F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260604150755.2487555-3-gnq25@mails.tsinghua.edu.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] BPF subsystem multi-line comment style violation.
--
commit 86bbbe949c13579e90a39499cabd9dc701da0bef
Author: Nuiqi Gui <gnq25@mails.tsinghua.edu.cn>
selftests/bpf: add tests for PTR_TO_FLOW_KEYS constant offset bounds
This commit adds verifier tests for constant pointer arithmetic on a
PTR_TO_FLOW_KEYS register to ensure bounds checking works correctly.
It verifies that in-bounds arithmetic is accepted and out-of-bounds
is properly rejected.
> diff --git a/tools/testing/selftests/bpf/progs/verifier_flow_keys.c b/tools/testing/selftests/bpf/progs/verifier_flow_keys.c
> new file mode 100644
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/verifier_flow_keys.c
[ ... ]
> + : __imm_const(flow_keys, offsetof(struct __sk_buff, flow_keys))
> + : __clobber_all);
> +}
> +
> +/* Equivalent OOB expressed directly in insn->off; this form was always
> + * rejected and is kept to show both forms now share one diagnostic.
> + */
[Severity: Low]
This isn't a bug, but does this multi-line comment follow the preferred
BPF subsystem style? The guidelines specify that the opening /* should be
on its own line, with the comment text starting on the next line.
> +SEC("flow_dissector")
> +__description("flow_keys: OOB via insn->off rejected")
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260604150755.2487555-1-gnq25@mails.tsinghua.edu.cn?part=2
next prev parent reply other threads:[~2026-06-04 15:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 15:07 [PATCH bpf 0/2] bpf, verifier: fix PTR_TO_FLOW_KEYS constant-offset OOB Nuiqi Gui
2026-06-04 15:07 ` [PATCH bpf 1/2] bpf, verifier: fold reg->var_off into PTR_TO_FLOW_KEYS bounds check Nuiqi Gui
2026-06-04 15:40 ` sashiko-bot
2026-06-04 15:07 ` [PATCH bpf 2/2] selftests/bpf: add tests for PTR_TO_FLOW_KEYS constant offset bounds Nuiqi Gui
2026-06-04 15:45 ` sashiko-bot [this message]
2026-06-04 16:40 ` [PATCH bpf 0/2] bpf, verifier: fix PTR_TO_FLOW_KEYS constant-offset OOB Alexei Starovoitov
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=20260604154507.B5CB51F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=gnq25@mails.tsinghua.edu.cn \
--cc=sashiko-reviews@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.