All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Emil Tsalapatis" <emil@etsalapatis.com>, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next 1/4] libarena: remove in-code licenses
Date: Tue, 27 Oct 2026 16:36:48 +0000	[thread overview]
Message-ID: <sashiko-outbox-186933@kernel.org> (raw)
In-Reply-To: <20261027162916.10996-2-emil@etsalapatis.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] selftests/bpf: missing license section in libarena_bench.bpf.o
--

commit 1bfbb56cf90063a6a767e7e64926692dd815ff9b
Author: Emil Tsalapatis <emil@etsalapatis.com>

libarena: remove in-code licenses

This commit removes the SEC("license") definitions from the libarena BPF
source files (asan.bpf.c, buddy.bpf.c, and common.bpf.c) so that consumers
of libarena provide their own license section.

> diff --git a/tools/testing/selftests/bpf/libarena/src/asan.bpf.c b/tools/testing/selftests/bpf/libarena/src/asan.bpf.c
> index de656b69d13af..8a0f061106064 100644
> --- a/tools/testing/selftests/bpf/libarena/src/asan.bpf.c
> +++ b/tools/testing/selftests/bpf/libarena/src/asan.bpf.c
> @@ -532,5 +532,3 @@ __weak __noasan int asan_init(struct asan_init_args *args)
>  #pragma clang attribute pop
>  
>  #endif /* BPF_ARENA_ASAN */
> -
> -__weak char _license[] SEC("license") = "GPL";
> diff --git a/tools/testing/selftests/bpf/libarena/src/buddy.bpf.c b/tools/testing/selftests/bpf/libarena/src/buddy.bpf.c
> index 2490ab1396de0..552ce87875e3b 100644
> --- a/tools/testing/selftests/bpf/libarena/src/buddy.bpf.c
> +++ b/tools/testing/selftests/bpf/libarena/src/buddy.bpf.c
> @@ -899,5 +899,3 @@ __weak int buddy_free(struct buddy __arena *buddy, void __arena *addr)
>  
>  	return ret;
>  }
> -
> -__weak char _license[] SEC("license") = "GPL";
> diff --git a/tools/testing/selftests/bpf/libarena/src/common.bpf.c b/tools/testing/selftests/bpf/libarena/src/common.bpf.c
> index d1af60b818389..d859bd538c52d 100644
> --- a/tools/testing/selftests/bpf/libarena/src/common.bpf.c
> +++ b/tools/testing/selftests/bpf/libarena/src/common.bpf.c
> @@ -85,5 +85,3 @@ __weak void arena_free(void __arena *ptr)
>  {
>  	buddy_free(&buddy, ptr);
>  }
> -
> -char _license[] SEC("license") = "GPL";

[Severity: Medium]
Does removing _license from common.bpf.c, buddy.bpf.c, and asan.bpf.c leave
libarena_bench.bpf.o without a license section and break the libarena
benchmarks at load time?

In tools/testing/selftests/bpf/libarena/Makefile, libarena_bench.bpf.o is
linked solely from LIBARENA_CORE_SOURCES and LIBARENA_BENCH_SOURCES:

    LIBARENA_BENCH_OBJECTS = $(notdir $(LIBARENA_CORE_SOURCES:.bpf.c=.bpf.o) \
                                      $(LIBARENA_BENCH_SOURCES:.bpf.c=.bpf.o))

Unlike the selftests in selftests/test_buddy.bpf.c and
selftests/test_asan_buddy.bpf.c, the benchmark source in
tools/testing/selftests/bpf/libarena/benchs/bench_malloc.bpf.c does not
define a SEC("license") section.

When running the libarena-malloc or libarena-calloc benchmarks in
tools/testing/selftests/bpf/benchs/bench_libarena.c:

    malloc_setup() / calloc_setup()
      -> setup_common()
           -> libarena_bench__open_and_load()

libarena_bench.bpf.o now loads with an empty license string, so the BPF
verifier rejects the programs with -EINVAL when checking GPL compatibility
for their kfunc calls, kernel BTF accesses, and bpf_trace_printk usage.

Should tools/testing/selftests/bpf/libarena/benchs/bench_malloc.bpf.c define
a SEC("license") section now that the core library sources no longer provide
one?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261027162916.10996-1-emil@etsalapatis.com?part=1

  reply	other threads:[~2026-10-27 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 16:29 [PATCH bpf-next 0/4] selftests/bpf: libarena: compatibility fixups Emil Tsalapatis
2026-10-27 16:29 ` [PATCH bpf-next 1/4] libarena: remove in-code licenses Emil Tsalapatis
2026-10-27 16:36   ` sashiko-bot [this message]
2026-10-27 16:29 ` [PATCH bpf-next 2/4] selftests/bpf: libarena: make allocator growth on alloc failure optional Emil Tsalapatis
2026-10-27 16:29 ` [PATCH bpf-next 3/4] selftests/bpf: libarena: add explicit buddy_grow() call Emil Tsalapatis
2026-10-27 16:52   ` sashiko-bot
2026-10-27 16:29 ` [PATCH bpf-next 4/4] selftests/bpf: libarena: Make zero variable type __u32 instead of u32 Emil Tsalapatis

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=sashiko-outbox-186933@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=emil@etsalapatis.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.