Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: "Tianyi Chen" <hi@tychen.cc>, <bpf@vger.kernel.org>
Cc: "Alexis Lothoré" <alexis.lothore@bootlin.com>,
	qmo@kernel.org, andrii@kernel.org, eddyz87@gmail.com,
	ihor.solodrai@linux.dev, ast@kernel.org, daniel@iogearbox.net,
	shuah@kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf] selftests/bpf: Look up unpinned maps by ID in bpftool_maps_access
Date: Thu, 05 Nov 2026 10:54:02 +0100	[thread overview]
Message-ID: <DMN6PJC05X2R.2PXWV13VGT156@bootlin.com> (raw)
In-Reply-To: <20261104183323.409412-1-hi@tychen.cc>

Hi Tianyi,

On Wed Nov 4, 2026 at 7:33 PM CET, Tianyi Chen wrote:
> The unpinned subtests pass "name prot_map" or "name not_prot_map" to
> bpftool. Both maps are used by programs attached through trampolines,
> which are freed only after RCU grace periods and hold their map
> references until then. A run's maps therefore stay in the map ID table
> after its skeleton is destroyed, for about 300 ms in an x86-64 VM.
>
> If the test runs again within that window, the name matches maps from
> both runs, bpftool fails with "several maps match this handle", and
> the unpinned subtests fail.
>
> Look up these maps by ID instead and drop the now unused map names.
>
> Fixes: 2d96bbdfd3b5 ("selftests/bpf: convert test_bpftool_map_access.sh into test_progs framework")
> Assisted-by: LLM
> Signed-off-by: Tianyi Chen <hi@tychen.cc>

I've reproduced locally in my VM the mentioned issue (and saw the
"Error: several maps match this handle") with:

  while true; do ./test_progs -a bpftool_maps_access/unprotected_unpinned; done

With your patch applied, I don't see the error anymore. The fix
looks sane to me.

Tested-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Reviewed-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>

Thanks, Alexis

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2026-11-05  9:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 18:33 [PATCH bpf] selftests/bpf: Look up unpinned maps by ID in bpftool_maps_access Tianyi Chen
2026-11-05  9:54 ` Alexis Lothoré [this message]
2026-11-05 16:40 ` 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=DMN6PJC05X2R.2PXWV13VGT156@bootlin.com \
    --to=alexis.lothore@bootlin.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=hi@tychen.cc \
    --cc=ihor.solodrai@linux.dev \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=qmo@kernel.org \
    --cc=shuah@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