All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Chaignon <paul.chaignon@gmail.com>
To: Weiming Shi <bestswngs@gmail.com>
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	bpf@vger.kernel.org, Xiang Mei <xmei5@asu.edu>
Subject: Re: [PATCH bpf v2 2/2] selftests/bpf: add get_next_key boundary test for cgroup_storage
Date: Fri, 3 Apr 2026 16:16:56 +0200	[thread overview]
Message-ID: <ac_L2C42x33hyJFX@mail.gmail.com> (raw)
In-Reply-To: <20260403132951.43533-3-bestswngs@gmail.com>

On Fri, Apr 03, 2026 at 09:29:51PM +0800, Weiming Shi wrote:
> Verify that bpf_map__get_next_key() correctly returns -ENOENT when
> called on the last (and only) key in a cgroup_storage map. Before the
> fix in the previous patch, this would succeed with bogus key data
> instead of failing.
> 
> Suggested-by: Paul Chaignon <paul.chaignon@gmail.com>
> Signed-off-by: Weiming Shi <bestswngs@gmail.com>

Acked-by: Paul Chaignon <paul.chaignon@gmail.com>

> ---
>  tools/testing/selftests/bpf/prog_tests/cgroup_storage.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_storage.c b/tools/testing/selftests/bpf/prog_tests/cgroup_storage.c
> index cf395715ced47..5451a43b3563e 100644
> --- a/tools/testing/selftests/bpf/prog_tests/cgroup_storage.c
> +++ b/tools/testing/selftests/bpf/prog_tests/cgroup_storage.c
> @@ -86,6 +86,11 @@ void test_cgroup_storage(void)
>  	err = SYS_NOFAIL(PING_CMD);
>  	ASSERT_OK(err, "sixth ping");
>  
> +	err = bpf_map__get_next_key(skel->maps.cgroup_storage, &key, &key,
> +				    sizeof(key));
> +	ASSERT_ERR(err, "bpf_map__get_next_key should fail");
> +	ASSERT_EQ(errno, ENOENT, "no second key");
> +
>  cleanup_progs:
>  	cgroup_storage__destroy(skel);
>  cleanup_network:
> -- 
> 2.43.0
> 

  reply	other threads:[~2026-04-03 14:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03 13:29 [PATCH bpf v2 0/2] bpf: fix end-of-list detection in cgroup_storage_get_next_key() Weiming Shi
2026-04-03 13:29 ` [PATCH bpf v2 1/2] " Weiming Shi
2026-04-03 13:29 ` [PATCH bpf v2 2/2] selftests/bpf: add get_next_key boundary test for cgroup_storage Weiming Shi
2026-04-03 14:16   ` Paul Chaignon [this message]
2026-04-06  1:50 ` [PATCH bpf v2 0/2] bpf: fix end-of-list detection in cgroup_storage_get_next_key() 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=ac_L2C42x33hyJFX@mail.gmail.com \
    --to=paul.chaignon@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bestswngs@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=roman.gushchin@linux.dev \
    --cc=song@kernel.org \
    --cc=xmei5@asu.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 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.