BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Leon Hwang" <leon.hwang@linux.dev>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v5 7/9] selftests/bpf: Add tests to verify verifier log for global percpu data
Date: Mon, 08 Jun 2026 15:22:27 +0000	[thread overview]
Message-ID: <20260608152227.E39071F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260608145113.65857-8-leon.hwang@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] `RUN_TESTS` macro is incorrectly wrapped inside `test__start_subtest()`, which breaks the subtest hierarchy.
--

commit 1dcc43260f6040ba128a20fe56dd3f75bb90a451
Author: Leon Hwang <leon.hwang@linux.dev>

selftests/bpf: Add tests to verify verifier log for global percpu data

This patch adds two tests to verify the verifier log output when a
percpu_array map is incorrectly used as a const string.

> diff --git a/tools/testing/selftests/bpf/prog_tests/global_data_init.c b/tools/testing/selftests/bpf/prog_tests/global_data_init.c
> --- a/tools/testing/selftests/bpf/prog_tests/global_data_init.c
> +++ b/tools/testing/selftests/bpf/prog_tests/global_data_init.c
[ ... ]
> @@ -244,6 +244,11 @@ static void test_global_percpu_data_lskel(void)
>  	free(online);
>  }
>  
> +static void test_global_percpu_data_verifier_log(void)
> +{
> +	RUN_TESTS(test_global_percpu_data);
> +}
> +
>  void test_global_percpu_data(void)
>  {
[ ... ]
> @@ -255,4 +260,6 @@ void test_global_percpu_data(void)
>  		test_global_percpu_data_init();
>  	if (test__start_subtest("lskel"))
>  		test_global_percpu_data_lskel();
> +	if (test__start_subtest("verifier_log"))
> +		test_global_percpu_data_verifier_log();

[Severity: Medium]
Does this accidentally break the subtest hierarchy?

The BPF selftests framework does not support nested subtests, and
test__start_subtest_with_desc() explicitly calls test__end_subtest() if a
subtest is already active.

Because RUN_TESTS() internally creates a new subtest for each program in the
skeleton, invoking test_global_percpu_data_verifier_log() while the
"verifier_log" subtest is active will immediately terminate the "verifier_log"
subtest.

This causes the parent subtest to falsely report as passing with zero
assertions, and the skeleton tests will run as flat peer subtests rather than
being logically grouped.

Could RUN_TESTS() be used directly here without wrapping it in
test__start_subtest()?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260608145113.65857-1-leon.hwang@linux.dev?part=7

  reply	other threads:[~2026-06-08 15:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 14:51 [PATCH bpf-next v5 0/9] bpf: Introduce global percpu data Leon Hwang
2026-06-08 14:51 ` [PATCH bpf-next v5 1/9] bpf: Drop duplicate blank lines in verifier Leon Hwang
2026-06-08 14:51 ` [PATCH bpf-next v5 2/9] bpf: Introduce global percpu data Leon Hwang
2026-06-08 15:13   ` sashiko-bot
2026-06-08 15:56   ` bot+bpf-ci
2026-06-08 14:51 ` [PATCH bpf-next v5 3/9] libbpf: Probe percpu data feature Leon Hwang
2026-06-08 15:05   ` sashiko-bot
2026-06-08 14:51 ` [PATCH bpf-next v5 4/9] libbpf: Add support for global percpu data Leon Hwang
2026-06-08 14:51 ` [PATCH bpf-next v5 5/9] bpftool: Generate skeleton " Leon Hwang
2026-06-08 15:11   ` sashiko-bot
2026-06-08 15:29   ` bot+bpf-ci
2026-06-08 14:51 ` [PATCH bpf-next v5 6/9] selftests/bpf: Add tests to verify " Leon Hwang
2026-06-08 15:20   ` sashiko-bot
2026-06-08 14:51 ` [PATCH bpf-next v5 7/9] selftests/bpf: Add tests to verify verifier log for " Leon Hwang
2026-06-08 15:22   ` sashiko-bot [this message]
2026-06-08 14:51 ` [PATCH bpf-next v5 8/9] selftests/bpf: Add test to verify xlated insns " Leon Hwang
2026-06-08 15:21   ` sashiko-bot
2026-06-08 14:51 ` [PATCH bpf-next v5 9/9] selftests/bpf: Add test to verify bpf_iter " Leon Hwang

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=20260608152227.E39071F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=leon.hwang@linux.dev \
    --cc=sashiko-reviews@lists.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