BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Puranjay Mohan <puranjay@kernel.org>, bpf@vger.kernel.org
Cc: 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 11:35:02 -0700	[thread overview]
Message-ID: <42bc3b8552fa2dec468747fc3e81a6b011222b84.camel@gmail.com> (raw)
In-Reply-To: <20251017141727.51355-1-puranjay@kernel.org>

On Fri, 2025-10-17 at 14:17 +0000, Puranjay Mohan wrote:
> The __list_del fuction doesn't set the previous node's next pointer to
> the next node of the node to be deleted. It just updates the local variable
> and not the actual pointer in the previous node.
> 
> The test was passing up till now because the bpf code is doing bpf_free()
> after list_del and therfore reading head->first from the userspace will
> read all zeroes. But after arena_list_del() is finished, head->first should
> point to NULL;
> 
> If you remove the bpf_free() call in arena_list_del(), the test will start
> crashing because now the userpsace will read 0x100 (LIST_POISON1) in
> head->first and segfault.

I tried commenting out bpf_free() in arena_list_del() but the test
passes for me even w/o this patch.  Is there a way to modify the test
case, so that logic of the list_del() is checked more thoroughly?

> Signed-off-by: Puranjay Mohan <puranjay@kernel.org>

[...]

  parent reply	other threads:[~2025-10-17 18:35 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 [this message]
2025-10-17 19:09   ` Puranjay Mohan
2025-10-17 19:30     ` Yonghong Song
2025-10-17 19:55     ` Eduard Zingerman
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=42bc3b8552fa2dec468747fc3e81a6b011222b84.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=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