BPF List
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v6 10/12] selftests/bpf: Add tests to verify verifier log for global percpu data
Date: Tue, 16 Jun 2026 12:18:03 +0800	[thread overview]
Message-ID: <eee4d7d4-fb6c-4222-9cc7-82201bc1c85e@linux.dev> (raw)
In-Reply-To: <20260615154049.6A4161F000E9@smtp.kernel.org>

On 15/6/26 23:40, sashiko-bot@kernel.org wrote:
[...]
>> +SEC("?kprobe")
>> +__failure __msg("R{{[0-9]+}} points to percpu_array map which cannot be used as const string")
>> +int verifier_snprintf(void *ctx)
>> +{
>> +	u64 args[] = { data };
>> +	char buf[128];
>> +	int len;
>> +
>> +	len = bpf_snprintf(buf, sizeof(buf), fmt, args, 1);
> 
> [Severity: Low]
> Should this be passing sizeof(args) instead of 1?
> 
> The bpf_snprintf helper requires data_len to be the size of the data array
> in bytes. Passing 1 makes the test brittle if the verifier's argument
> evaluation order changes in the future, as it would fail on the data_len
> argument before checking the fmt argument.
> 
Will use sizeof(args).

Thanks,
Leon


  reply	other threads:[~2026-06-16  4:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15 15:26 [PATCH bpf-next v6 00/12] bpf: Introduce global percpu data Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 01/12] bpf: Drop duplicate blank lines in verifier Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 02/12] bpf: Disallow interpreter fallback for user BPF_ADDR_SPACE_CAST insn Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 03/12] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 04/12] bpf: Introduce global percpu data Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 05/12] libbpf: Probe percpu data feature Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 06/12] libbpf: Add support for global percpu data Leon Hwang
2026-06-15 15:41   ` sashiko-bot
2026-06-16  4:17     ` Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 07/12] bpftool: Generate skeleton " Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 08/12] selftests/bpf: Add tests to verify " Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 09/12] selftests/bpf: Add test to verify accessing rdonly percpu_array Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 10/12] selftests/bpf: Add tests to verify verifier log for global percpu data Leon Hwang
2026-06-15 15:40   ` sashiko-bot
2026-06-16  4:18     ` Leon Hwang [this message]
2026-06-15 15:26 ` [PATCH bpf-next v6 11/12] selftests/bpf: Add test to verify xlated insns " Leon Hwang
2026-06-15 21:29   ` Alexei Starovoitov
2026-06-16  4:18     ` Leon Hwang
2026-06-16  4:23       ` Alexei Starovoitov
2026-06-16  4:33         ` Leon Hwang
2026-06-15 15:26 ` [PATCH bpf-next v6 12/12] selftests/bpf: Add test to verify bpf_iter " Leon Hwang

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=eee4d7d4-fb6c-4222-9cc7-82201bc1c85e@linux.dev \
    --to=leon.hwang@linux.dev \
    --cc=bpf@vger.kernel.org \
    --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