mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: chenyy23@mails.tsinghua.edu.cn,bpf@vger.kernel.org
Cc: chenyy23@mails.tsinghua.edu.cn,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,emil@etsalapatis.com,john.fastabend@gmail.com,shuah@kernel.org,linux-kselftest@vger.kernel.org,linux-kernel@vger.kernel.org,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf v5 2/2] selftests/bpf: Add skb dynptr writer packet invalidation tests
Date: Mon, 15 Jun 2026 18:39:43 +0000 (UTC)	[thread overview]
Message-ID: <22a4e602da5c745be6947e9ebf41759432280a7697b74614d84c55ba9c10aed5@mail.kernel.org> (raw)
In-Reply-To: <7feeed42d8b97d0db0eab2c1c30aa86f110fe49c.1781539814.git.chenyy23@mails.tsinghua.edu.cn>

[-- Attachment #1: Type: text/plain, Size: 2000 bytes --]

> diff --git a/tools/testing/selftests/bpf/progs/dynptr_fail.c b/tools/testing/selftests/bpf/progs/dynptr_fail.c
> index b62773ce5219..aa9374dbdb11 100644
> --- a/tools/testing/selftests/bpf/progs/dynptr_fail.c
> +++ b/tools/testing/selftests/bpf/progs/dynptr_fail.c
> @@ -1232,6 +1232,244 @@ int skb_invalid_data_slice4(struct __sk_buff *skb)
>  	return SK_PASS;
>  }
>

[ ... ]

> +SEC("?tc")
> +__failure __msg("invalid mem access 'scalar'")
> +int skb_pkt_ptr_invalid_after_global_dynptr_write(struct __sk_buff *skb)
> +{
> +	__u8 *data = (void *)(long)skb->data;
> +	__u8 *data_end = (void *)(long)skb->data_end;
> +	struct bpf_dynptr ptr;
> +
> +	if (data + 1 > data_end)
> +		return SK_DROP;
> +
> +	bpf_dynptr_from_skb(skb, 0, &ptr);
> +	global_dynptr_helper_write(&ptr);
> +
> +	/* this should fail */
> +	return *data;
> +}

These new cases all assert __failure with __msg("invalid mem access
'scalar'"), meaning they expect the verifier to invalidate the direct
packet pointer after a skb dynptr write.

This expectation matches the verifier behavior change in the companion
patch 1/2 of the series. That verifier change was rejected during review:
Alexei Starovoitov replied "Nack. You misunderstand what
bpf_is_kfunc_pkt_changing() is doing." and later "There is nothing to
fix.", stating the existing verifier behavior is correct.

If the existing verifier behavior is correct and packet pointers are not
invalidated by these dynptr writes, would these __failure expectations
hold? It looks like they encode the disputed behavior from the rejected
patch 1/2, so should this selftest patch land on its own?

The author appears to have agreed in the discussion and withdrawn the
series. Was this patch intended to be dropped along with patch 1/2?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/27565623381

      reply	other threads:[~2026-06-15 18:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15 12:28 [PATCH bpf v2 0/2] bpf: Fix packet pointer invalidation for skb dynptr writes Yiyang Chen
2026-06-15 12:28 ` [PATCH bpf v2 1/2] " Yiyang Chen
2026-06-15 12:28 ` [PATCH bpf v2 2/2] selftests/bpf: Add skb dynptr writer packet invalidation tests Yiyang Chen
2026-06-15 14:14 ` [PATCH bpf v3 0/2] bpf: Fix packet pointer invalidation for skb dynptr writes Yiyang Chen
2026-06-15 14:14   ` [PATCH bpf v3 1/2] " Yiyang Chen
2026-06-15 15:52     ` Alexei Starovoitov
2026-06-15 16:46       ` Yiyang Chen
2026-06-15 17:30         ` Alexei Starovoitov
2026-06-15 17:59           ` Yiyang Chen
2026-06-15 14:14   ` [PATCH bpf v3 2/2] selftests/bpf: Add skb dynptr writer packet invalidation tests Yiyang Chen
2026-06-15 15:15   ` [PATCH bpf v4 0/2] bpf: Fix packet pointer invalidation for skb dynptr writes Yiyang Chen
2026-06-15 15:15     ` [PATCH bpf v4 1/2] " Yiyang Chen
2026-06-15 15:15     ` [PATCH bpf v4 2/2] selftests/bpf: Add skb dynptr writer packet invalidation tests Yiyang Chen
2026-06-15 16:26       ` bot+bpf-ci
2026-06-15 17:49     ` [PATCH bpf v5 0/2] bpf: Fix packet pointer invalidation for skb dynptr writes Yiyang Chen
2026-06-15 17:49       ` [PATCH bpf v5 1/2] " Yiyang Chen
2026-06-15 17:52         ` Alexei Starovoitov
2026-06-15 17:49       ` [PATCH bpf v5 2/2] selftests/bpf: Add skb dynptr writer packet invalidation tests Yiyang Chen
2026-06-15 18:39         ` bot+bpf-ci [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=22a4e602da5c745be6947e9ebf41759432280a7697b74614d84c55ba9c10aed5@mail.kernel.org \
    --to=bot+bpf-ci@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chenyy23@mails.tsinghua.edu.cn \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --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®