BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Viktor Malik" <vmalik@redhat.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next 3/4] selftests/bpf: Silence array bounds warning in global_map_resize
Date: Wed, 15 Jul 2026 11:28:04 +0000	[thread overview]
Message-ID: <20260715112805.0AB3A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <57765bc465a27923c3c093eba222cc24d08d8c40.1784112948.git.vmalik@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Multi-line comment opening '/*' is not on its own line.
--

--- Patch [3]: [PATCH bpf-next 3/4] selftests/bpf: Silence array bounds warning in global_map_resize ---
commit 477df4be9ab84dd41e948528c2cecec30f56ae6a
Author: Viktor Malik <vmalik@redhat.com>

selftests/bpf: Silence array bounds warning in global_map_resize

This commit silences a GCC false positive array bounds violation warning in
global_map_resize. It achieves this by accessing the BPF map array via a
plain pointer after it has been resized from within the BPF program.

> diff --git a/tools/testing/selftests/bpf/prog_tests/global_map_resize.c b/tools/testing/selftests/bpf/prog_tests/global_map_resize.c
> --- a/tools/testing/selftests/bpf/prog_tests/global_map_resize.c
> +++ b/tools/testing/selftests/bpf/prog_tests/global_map_resize.c

[ ... ]

> @@ -58,10 +59,13 @@ static void global_map_resize_bss_subtest(void)
>  		goto teardown;
>  
>  	/* fill the newly resized array with ones,
> -	 * skipping the first element which was previously set
> +	 * skipping the first element which was previously set;
> +	 * access through a plain pointer to avoid -Warray-bounds
> +	 * since the array was resized beyond its declared length.
>  	 */

[Severity: Low]
This isn't a bug, but does this multi-line comment follow the preferred BPF
coding style? 

The BPF subsystem guidelines require that multi-line comments have the
opening '/*' on its own line, even when modifying surrounding code that
uses the old style.

> +	array = skel->bss->array;
>  	for (int i = 1; i < array_len; i++)
> -		skel->bss->array[i] = 1;
> +		array[i] = 1;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1784112948.git.vmalik@redhat.com?part=3

  reply	other threads:[~2026-07-15 11:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 11:21 [PATCH bpf-next 0/4] selftests/bpf: Fix compilation with RELEASE=1 Viktor Malik
2026-07-15 11:22 ` [PATCH bpf-next 1/4] selftests/bpf: Check malloc result with ASSERT_NEQ in test_loader Viktor Malik
2026-07-15 11:22 ` [PATCH bpf-next 2/4] selftests/bpf: Check malloc result with ASSERT_NEQ in test_sha256 Viktor Malik
2026-07-15 11:22 ` [PATCH bpf-next 3/4] selftests/bpf: Silence array bounds warning in global_map_resize Viktor Malik
2026-07-15 11:28   ` sashiko-bot [this message]
2026-07-15 11:22 ` [PATCH bpf-next 4/4] selftests/bpf: Silence maybe-uninitialized compiler warning in libarena Viktor Malik
2026-07-15 12:10 ` [PATCH bpf-next 0/4] selftests/bpf: Fix compilation with RELEASE=1 Kumar Kartikeya Dwivedi
2026-07-15 13:30   ` Viktor Malik

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=20260715112805.0AB3A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vmalik@redhat.com \
    /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