BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: sun jian <sun.jian.kdev@gmail.com>, Shung-Hsi Yu <shung-hsi.yu@suse.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko	 <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Emil Tsalapatis	 <emil@etsalapatis.com>,
	Jiri Olsa <jolsa@kernel.org>,
	John Fastabend	 <john.fastabend@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	 Martin KaFai Lau <martin.lau@linux.dev>,
	Shuah Khan <shuah@kernel.org>, Song Liu <song@kernel.org>,
	Yonghong Song	 <yonghong.song@linux.dev>,
	Matt Mullins <mmullins@mmlx.us>,
	 linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	 stable@vger.kernel.org
Subject: Re: [PATCH bpf v5 2/2] selftests/bpf: Cover negative buffer pointer offsets
Date: Wed, 15 Jul 2026 01:54:37 -0700	[thread overview]
Message-ID: <488c235db713648bb2f5c90e4389c96a97ebcdde.camel@gmail.com> (raw)
In-Reply-To: <CABFUUZFsJsF-C5Z2gb3FkZ7WD=vBavnGdZ7veScP_+dwZLsaMg@mail.gmail.com>

On Wed, 2026-07-15 at 13:26 +0800, sun jian wrote:

[...]

> > Anyway, still recommend adding a regression test that test access to one
> > byte before the start of writable context.
> > 
> 
> The new tracepoint_writable_reject_negative_const_offset verifier case
> already covers an access before the start of the writable context:
> 
>     r6 = *(u64 *)(r1 + 0);
>     r6 += -8;
>     r0 = *(u64 *)(r6 + 0);
> 
> Its effective access range is [-8, 0), so it is rejected at load time.
> This is the direct regression test for the negative-start case.

The existing test seem to be sufficient, why would it matter is at
offset -8 or -1 given that the read is appropriately sized?

The added test in tools/testing/selftests/bpf/progs/verifier_raw_tp_writable.c
is redundant given the changes in raw_tp_writable_reject_bad_access.c
but I was going to apply anyway.

  reply	other threads:[~2026-07-15  8:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  9:38 [PATCH bpf v5 0/2] bpf: Reject negative const offsets for buffer pointers Sun Jian
2026-07-14  9:38 ` [PATCH bpf v5 1/2] " Sun Jian
2026-07-14  9:38 ` [PATCH bpf v5 2/2] selftests/bpf: Cover negative buffer pointer offsets Sun Jian
2026-07-15  3:02   ` Shung-Hsi Yu
2026-07-15  4:15   ` Shung-Hsi Yu
2026-07-15  4:23     ` Shung-Hsi Yu
2026-07-15  5:26       ` sun jian
2026-07-15  8:54         ` Eduard Zingerman [this message]
2026-07-15  9:16           ` Shung-Hsi Yu
2026-07-15  9:40 ` [PATCH bpf v5 0/2] bpf: Reject negative const offsets for buffer pointers 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=488c235db713648bb2f5c90e4389c96a97ebcdde.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=emil@etsalapatis.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=mmullins@mmlx.us \
    --cc=shuah@kernel.org \
    --cc=shung-hsi.yu@suse.com \
    --cc=song@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=sun.jian.kdev@gmail.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