BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Puranjay Mohan <puranjay12@gmail.com>
Cc: Puranjay Mohan <puranjay@kernel.org>,
	bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	 Martin KaFai Lau <martin.lau@kernel.org>,
	kkd@meta.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next] selftests/bpf: fix list_del() in arena list
Date: Fri, 17 Oct 2025 12:55:54 -0700	[thread overview]
Message-ID: <69e47b00df3d20b7cd5cd39896ee612ec6165a10.camel@gmail.com> (raw)
In-Reply-To: <CANk7y0jgRC3W6hQzJjfX0NX1PrttcDxSZLcXdB1jo_qxTFTVZg@mail.gmail.com>

On Fri, 2025-10-17 at 21:09 +0200, Puranjay Mohan wrote:

[...]

> [root@localhost bpf]# ./test_progs -a arena_list
> #5       arena_list:FAIL
> Caught signal #11!
> Stack trace:
> ./test_progs(crash_handler+0x1c)[0x956fd4]
> linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0xffff885b7820]
> ./test_progs[0x559f00]
> ./test_progs[0x55a728]
> ./test_progs(test_arena_list+0x28)[0x55aa7c]
> ./test_progs[0x957624]
> ./test_progs(main+0x6a0)[0x959298]
> /lib64/libc.so.6(+0x30558)[0xffff87e62558]
> /lib64/libc.so.6(__libc_start_main+0x9c)[0xffff87e6263c]
> ./test_progs(_start+0x30)[0x5522f0]
> 
> I pushed it to the CI so you can see it fail:
> https://github.com/kernel-patches/bpf/actions/runs/18602175717/job/53043507792
> 
> Another thing you can do in addition to commenting bpf_free() is to also comment
> 
> //n->next = LIST_POISON1;
> //n->pprev = LIST_POISON2;
> 
> and now the test will not crash but fail like:
> 
> test_arena_list_add_del:FAIL:sum of list elems after del unexpected
> sum of list elems after del: actual 499500 != expected 0

Ok, that was an error on my side. The test fails after clean rebuild,
sorry for the noise.

But my point is that if we care about list_del() correctness, the test
should be modified so that the bug is visible w/o commenting anything.

> This is because __list_del is a no-op, and after the poisoning logic
> is commented list_del() becomes a no-op.
> The list stays intact after arena_list_del() finishes.

Yes, I understand what you are fixing.

  parent reply	other threads:[~2025-10-17 19:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 14:17 [PATCH bpf-next] selftests/bpf: fix list_del() in arena list Puranjay Mohan
2025-10-17 16:31 ` Yonghong Song
2025-10-17 18:35 ` Eduard Zingerman
2025-10-17 19:09   ` Puranjay Mohan
2025-10-17 19:30     ` Yonghong Song
2025-10-17 19:55     ` Eduard Zingerman [this message]
2025-10-17 18:41 ` Alexei Starovoitov
2025-10-17 19:18   ` Puranjay Mohan
2025-10-17 21:11     ` Alexei Starovoitov
2025-10-19  2:30 ` 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=69e47b00df3d20b7cd5cd39896ee612ec6165a10.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=kernel-team@meta.com \
    --cc=kkd@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=puranjay12@gmail.com \
    --cc=puranjay@kernel.org \
    /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