All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Emil Tsalapatis" <emil@etsalapatis.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v8 8/8] selftests/bpf: Reuse stderr parsing for libarena ASAN tests
Date: Tue, 21 Apr 2026 22:16:51 +0000	[thread overview]
Message-ID: <20260421221653.75221C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260421165037.4736-9-emil@etsalapatis.com>

Sashiko AI review found 1 potential issue(s):
- [Medium] The `verify_test_stderr()` function ignores unprivileged stderr test tags (`__stderr_unpriv`), silently skipping their verification.
--

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

selftests/bpf: Reuse stderr parsing for libarena ASAN tests

This commit adds code to directly test the output of libarena ASAN tests by
reusing testing infrastructure from BPF streams. It introduces a new
verify_test_stderr() helper and test tags to validate stderr output against
expected messages.

> diff --git a/tools/testing/selftests/bpf/libarena/include/test_progs_compat.h b/tools/testing/selftests/bpf/libarena/include/test_progs_compat.h
> new file mode 100644
> index 0000000000000..9d431376c42f2
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/libarena/include/test_progs_compat.h
[ ... ]
> +#define __stderr(msg)		__test_tag("test_expect_stderr=" msg)
> +#define __stderr_unpriv(msg)	__test_tag("test_expect_stderr_unpriv=" msg)

[ ... ]

> diff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c
> index c4c34cae61027..ee637809a1d4e 100644
> --- a/tools/testing/selftests/bpf/test_loader.c
> +++ b/tools/testing/selftests/bpf/test_loader.c
[ ... ]
> +void verify_test_stderr(struct bpf_object *obj, struct bpf_program *prog)
> +{
> +	struct test_spec spec = {};
> +
> +	if (parse_test_spec(NULL, obj, prog, &spec))
> +		return;
> +
> +	verify_stderr(bpf_program__fd(prog), &spec.priv.stderr);

Does this code ignore unprivileged stderr test tags?

It appears that verify_test_stderr() hardcodes the use of &spec.priv.stderr.
Since it lacks an unprivileged parameter to select the unprivileged spec,
any expected messages specified via __stderr_unpriv() might be silently
ignored.

> +	free_test_spec(&spec);
> +}

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

      reply	other threads:[~2026-04-21 22:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 16:50 [PATCH bpf-next v8 0/8] Introduce arena library and runtime Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 1/8] selftests/bpf: Add ifdef guard for WRITE_ONCE macro in bpf_atomic.h Emil Tsalapatis
2026-04-23  8:27   ` Matt Bobrowski
2026-04-21 16:50 ` [PATCH bpf-next v8 2/8] selftests/bpf: Add basic libarena scaffolding Emil Tsalapatis
2026-04-21 20:08   ` sashiko-bot
2026-04-23  8:24   ` Matt Bobrowski
2026-04-26 18:42     ` Alexei Starovoitov
2026-04-26 18:58       ` Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 3/8] selftests/bpf: Move arena-related headers into libarena Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 4/8] selftests/bpf: Add arena ASAN runtime to libarena Emil Tsalapatis
2026-04-21 20:48   ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 5/8] selftests/bpf: Add ASAN support for libarena selftests Emil Tsalapatis
2026-04-21 21:15   ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 6/8] selftests/bpf: Add buddy allocator for libarena Emil Tsalapatis
2026-04-21 17:52   ` bot+bpf-ci
2026-04-21 17:56     ` Emil Tsalapatis
2026-04-21 21:42   ` sashiko-bot
2026-04-23  8:44   ` Matt Bobrowski
2026-04-23 14:00     ` Kumar Kartikeya Dwivedi
2026-04-23 16:43       ` Emil Tsalapatis
2026-04-23 20:24         ` Matt Bobrowski
2026-04-24 15:25           ` Emil Tsalapatis
2026-04-21 16:50 ` [PATCH bpf-next v8 7/8] selftests/bpf: Add selftests for libarena buddy allocator Emil Tsalapatis
2026-04-21 21:57   ` sashiko-bot
2026-04-21 16:50 ` [PATCH bpf-next v8 8/8] selftests/bpf: Reuse stderr parsing for libarena ASAN tests Emil Tsalapatis
2026-04-21 22:16   ` sashiko-bot [this message]

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=20260421221653.75221C2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=emil@etsalapatis.com \
    --cc=sashiko@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.