BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Qiliang Yuan" <odys.yuan@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next 5/5] selftests/bpf: Test log_true_size with an error from blinding
Date: Mon, 02 Nov 2026 12:45:15 +0000	[thread overview]
Message-ID: <sashiko-outbox-193441@kernel.org> (raw)
In-Reply-To: <20261102-bpf-blind-nops-fixes-v1-5-844300e42cdb@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/bpf: standalone blinding_log.c added for single narrow test case
--

commit 34995a62836807ba96cd4bc1543b3812e415d382
Author: Qiliang Yuan <odys.yuan@gmail.com>

selftests/bpf: Test log_true_size with an error from blinding

This commit adds a BPF selftest checking that log_true_size includes the
error message emitted when constant blinding with bpf_jit_harden=2 pushes a
jump out of its 16-bit range.

> diff --git a/tools/testing/selftests/bpf/prog_tests/blinding_log.c b/tools/testing/selftests/bpf/prog_tests/blinding_log.c
> new file mode 100644
> index 0000000000000..658a8494dae5b
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/blinding_log.c
> @@ -0,0 +1,59 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* The verifier log of a prog whose constants are blinded */
> +
> +#include <test_progs.h>
> +#include <linux/filter.h>
> +#include "sysctl_helpers.h"
> +
> +#define NR_CONSTS 11000
> +#define LOG_SIZE 65536
> +
> +/*
> + * A prog of one function gets its constants blinded when its runtime is
> + * selected. Each 'r0 += 1' becomes 3 insns, which pushes the jump over them
> + * out of its 16-bit range. Serial, because it sets bpf_jit_harden.
> + */
> +void serial_test_blinding_log(void)

[Severity: Low]
This isn't a bug, but tools/testing/selftests/bpf/prog_tests/patch_list.c
already defines serial_test_patch_list() in the same directory to test
patch-list constant blinding while toggling /proc/sys/net/core/bpf_jit_harden
to 2 via sysctl_set_or_fail() and checking is_jit_enabled():

tools/testing/selftests/bpf/prog_tests/patch_list.c:
void serial_test_patch_list(void)
{
	if (test__start_subtest("line_and_func_info"))
		test_line_and_func_info();
	if (test__start_subtest("poke_descriptor"))
		test_poke_descriptor();
	if (test__start_subtest("classic_filter"))
		test_classic_filter();
}

Could this test case be added as a subtest inside serial_test_patch_list() in
tools/testing/selftests/bpf/prog_tests/patch_list.c instead of adding a
separate standalone file for a single test?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102-bpf-blind-nops-fixes-v1-0-844300e42cdb@gmail.com?part=5

      reply	other threads:[~2026-11-02 12:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 12:37 [PATCH bpf-next 0/5] bpf: Fix three bugs around constant blinding and nop removal Qiliang Yuan
2026-11-02 12:37 ` [PATCH bpf-next 1/5] bpf: Put the line info back when the JIT falls back after blinding Qiliang Yuan
2026-11-02 12:37 ` [PATCH bpf-next 2/5] bpf: Keep the barrier of a nospec insn when removing nops Qiliang Yuan
2026-11-02 12:37 ` [PATCH bpf-next 3/5] bpf: Finalize the verifier log after the runtime is selected Qiliang Yuan
2026-11-03 12:58   ` Xu Kuohai
2026-11-02 12:37 ` [PATCH bpf-next 4/5] selftests/bpf: Cover a nospec jump that becomes a nop Qiliang Yuan
2026-11-02 12:37 ` [PATCH bpf-next 5/5] selftests/bpf: Test log_true_size with an error from blinding Qiliang Yuan
2026-11-02 12:45   ` 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=sashiko-outbox-193441@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=odys.yuan@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox