From: "Emil Tsalapatis" <emil@etsalapatis.com>
To: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Emil Tsalapatis" <emil@etsalapatis.com>
Cc: <bpf@vger.kernel.org>, <ast@kernel.org>, <andrii@kernel.org>,
<daniel@iogearbox.net>, <eddyz87@gmail.com>, <song@kernel.org>
Subject: Re: [PATCH bpf-next v7 0/9] Introduce arena library and runtime
Date: Fri, 17 Apr 2026 12:33:27 -0400 [thread overview]
Message-ID: <DHVKPB8FLV9R.7ACP5WZ7Q751@etsalapatis.com> (raw)
In-Reply-To: <CAP01T75tGi6svN=2oPpw0m+-UcHk2gnOw989fB7GFh6J19ru4g@mail.gmail.com>
On Fri Apr 17, 2026 at 12:15 PM EDT, Kumar Kartikeya Dwivedi wrote:
> On Fri, 17 Apr 2026 at 15:43, Emil Tsalapatis <emil@etsalapatis.com> wrote:
>>
>> On Sun Apr 12, 2026 at 3:22 PM EDT, Kumar Kartikeya Dwivedi wrote:
>> > On Sun, 12 Apr 2026 at 19:45, Emil Tsalapatis <emil@etsalapatis.com> wrote:
>> >>
>> >> Add a new subdirectory to tools/testing/selftests/bpf called libarena,
>> >> along with programs useful for writing arena-based BPF code. This
>> >> patchset adds the following:
>> >>
>> >> 1) libarena, a subdirectory where arena BPF code that is generally useful
>> >> to BPF arena programs can be easily added and tested.
>> >>
>> >> 2) An ASAN runtime for BPF arena programs. BPF arenas allow for accessing
>> >> memory after it has been freed or if it is out of bounds, making it more
>> >> difficult to triage bugs combined to regular BPF. Use LLVM's recently added
>> >> support for address-space based sanitization to selectively sanitize just
>> >> the arena accesses.
>> >>
>> >> 3) A buddy memory allocator that can be reused by BPF programs to handle
>> >> memory allocation/deletion. The allocator uses the ASAN runtime to add
>> >> address sanitization if requested.
>> >>
>> >> The patch includes testing for the new allocators and ASAN features that
>> >> can be built from the top directory using "make libarena_test" and
>> >> "make libarena_test_asan". The generated binaries reside in libarena/.
>> >> The patch also adds test-progs-based selftests to the codebase for the
>> >> libarena code, so the new tests are run by ./test_progs.
>> >>
>> >
>> > I am back in the same position as I was with comments in [0].
>> >
>> > I.e., again, I don't see anything in the stream output (passing -v to
>> > test_libarena_asan) when I build it with clang 23 (LLVM tip).
>> > What am I doing wrong? (Leaving aside all feedback about integrating
>> > it in the regular test runner that is still unaddressed, thus tests do
>> > not run by default).
>> >
>> > [0]: https://lore.kernel.org/bpf/CAP01T75+BoQfQN=47NhYYviZttjCPb_CXNpa=DUC0=xSvdNZdA@mail.gmail.com
>>
>> The series introduces a selftest for the test runner called libarena. It
>> is introduced in patch 9 to avoid creating a runner that does nothing in
>> the previous patches. Tests run with test_progs like regular selftests.
>> For ASAN we do not have LLVM22 support in the CI yet so test_progs doesn't
>> exercise it.
>>
>> The stream output is suppressed by a switch in asan.c to make the output
>> of test_libarena_asan legible. Each test that expects to generate ASAN
>> will generate a ton of output. I will add userspace logic to consume
>> the splats instead of emitting them to keep the output sane.
>
> Why can't we put everything in test_progs instead of separate test_libarena?
> Then add some logic like existing stream tests for verifying / testing
> the generated output in ASAN mode.
> For example, libbpf doesn't have its own separate test suite. I think the same
> logic should apply to libarena.
>
libarena is different in that it's BPF code we distribute as source.
Plus, the test runner is an example of how to set up the arena state.
It's very little code and automatically identifies the selftests without
having to explicitly enumerate them, so it's not extra maintenance burden.
For followup patches it's been 0 LOC to either the libarena selftest or the
test_progs test.
> If LLVM 22 is a problem just detect and mark the test as skipped for
> now when unavailable.
>
Fair enough we can make it in the Makefile to check if the ASAN flag is
supported by the BPF backend before compiling the selftest, otherwise
make it a no-op.
>>
>> >
>> >> [...]
>>
next prev parent reply other threads:[~2026-04-17 16:33 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-12 17:45 [PATCH bpf-next v7 0/9] Introduce arena library and runtime Emil Tsalapatis
2026-04-12 17:45 ` [PATCH bpf-next v7 1/9] bpf: Allow instructions with arena source and non-arena dest registers Emil Tsalapatis
2026-04-12 19:54 ` Alexei Starovoitov
2026-04-12 17:45 ` [PATCH bpf-next v7 2/9] selftests/bpf: Add tests for non-arena/arena operations Emil Tsalapatis
2026-04-12 17:45 ` [PATCH bpf-next v7 3/9] selftests/bpf: Move bpf_arena_spin_lock.h to the top level Emil Tsalapatis
2026-04-12 19:31 ` Kumar Kartikeya Dwivedi
2026-04-17 16:07 ` Emil Tsalapatis
2026-04-12 17:45 ` [PATCH bpf-next v7 4/9] selftests/bpf: Move READ_ONCE/WRITE_ONCE macros to bpf_experimental.h Emil Tsalapatis
2026-04-12 19:33 ` Kumar Kartikeya Dwivedi
2026-04-17 16:06 ` Emil Tsalapatis
2026-04-17 16:21 ` Kumar Kartikeya Dwivedi
2026-04-17 16:38 ` Emil Tsalapatis
2026-04-12 17:45 ` [PATCH bpf-next v7 5/9] selftests/bpf: Add basic libarena scaffolding Emil Tsalapatis
2026-04-12 18:28 ` bot+bpf-ci
2026-04-12 18:31 ` Emil Tsalapatis
2026-04-12 17:45 ` [PATCH bpf-next v7 6/9] selftests/bpf: Add arena ASAN runtime to libarena Emil Tsalapatis
2026-04-12 18:28 ` bot+bpf-ci
2026-04-12 18:34 ` Emil Tsalapatis
2026-04-12 17:45 ` [PATCH bpf-next v7 7/9] selftests/bpf: Add ASAN support for libarena selftests Emil Tsalapatis
2026-04-12 17:45 ` [PATCH bpf-next v7 8/9] selftests/bpf: Add buddy allocator for libarena Emil Tsalapatis
2026-04-12 17:45 ` [PATCH bpf-next v7 9/9] selftests/bpf: Add selftests for libarena buddy allocator Emil Tsalapatis
2026-04-12 19:22 ` [PATCH bpf-next v7 0/9] Introduce arena library and runtime Kumar Kartikeya Dwivedi
2026-04-17 14:43 ` Emil Tsalapatis
2026-04-17 16:15 ` Kumar Kartikeya Dwivedi
2026-04-17 16:33 ` Emil Tsalapatis [this message]
2026-04-17 17:06 ` Alexei Starovoitov
2026-04-17 18:03 ` Emil Tsalapatis
2026-04-17 18:21 ` Alexei Starovoitov
2026-04-12 20:00 ` patchwork-bot+netdevbpf
2026-04-16 20:23 ` Matt Bobrowski
2026-04-16 20:31 ` Matt Bobrowski
2026-04-16 20:43 ` Song Liu
2026-04-17 5:59 ` Matt Bobrowski
2026-04-17 14:36 ` 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=DHVKPB8FLV9R.7ACP5WZ7Q751@etsalapatis.com \
--to=emil@etsalapatis.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=memxor@gmail.com \
--cc=song@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