mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: "Thiébaud Weksteen" <tweek@google.com>,
	"Quentin Monnet" <qmo@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Shuah Khan <shuah@kernel.org>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	Sid Nayyar <sidnayyar@google.com>,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf-next 1/2] selftests/bpf: Move verifier failure tests out of test_global_percpu_data
Date: Mon, 7 Sep 2026 23:24:10 +0800	[thread overview]
Message-ID: <534e5a3b-5160-4619-8b2e-27a81783e17f@linux.dev> (raw)
In-Reply-To: <CA+zpnLc-WAqE9rA0PsjvOFe_YCZOdVj9YAzuayGXx0nhpqtw7g@mail.gmail.com>

On 2026/9/7 13:46, Thiébaud Weksteen wrote:
> On Fri, Sep 4, 2026 at 4:07 PM Leon Hwang <leon.hwang@linux.dev> wrote:
>>
>> On 4/9/26 11:19, Thiébaud Weksteen wrote:
>>> Commit 4c9241bd731a ("selftests/bpf: Add tests to verify global percpu
>>> data") added test_global_percpu_data.c to LSKELS_EXTRA. Later, in commit
>>> 1ed2294b31fc ("selftests/bpf: Test verifier log for global percpu data")
>>> two verifier failure tests were added (verifier_strncmp and
>>> verifier_snprintf), both marked as non-autoload (SEC("?kprobe")).
>>>
>>> When bpftool generates light skeletons, non-autoloaded programs are
>>> skipped during loading, causing the loader program to store subsequent
>>> program FDs into incorrect skeleton struct fields (e.g. dump_percpu_data's
>>> FD was stored into verifier_strncmp's descriptor).
>>
>> IIUC, patch 2 will fix the issue totally.
>>
>> Better to add a subtest to verify both the issue and the fix?
> 
> Thanks for the review. That's right, patch 2 will fix the issue:
> bpftool will fail to build any program that is set up that way. That's
> why patch 1 is necessary; otherwise, the existing test would fail.
> 
> Just checking your suggestion: what I can do is add a new test to make
> sure that dump_percpu_data is set up as expected (fd > 0). I can write
> a new test_global_percpu_data_iter_lskel, that is similar to
> test_global_percpu_data_iter, but for lskel?
> 
> I can also write a test to ensure that bpftool fails when light
> skeletons are set up with autoload=false?
> 

imo, the rejection of autoload=false prog when generating light skeleton
is not friendly for users. Users should not care about mixing
autoload=false progs with autoload=true progs, even for light skeletons.

The users-friendly way is to skip those autoload=false progs when
generating light skeletons.

So, this is a bpftool issue. A selftest is unnecessary. You can verify
both the issue and the fix manually. Probably, paste the verification
result in the patch message.

Thanks,
Leon


  reply	other threads:[~2026-09-07 15:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04  3:19 Thiébaud Weksteen
2026-09-04  3:19 ` [PATCH bpf-next 2/2] bpftool: Reject non-autoload programs for light skeletons Thiébaud Weksteen
2026-09-04  4:13   ` bot+bpf-ci
2026-09-07 15:24   ` Quentin Monnet
2026-09-08  4:57     ` Thiébaud Weksteen
2026-09-04  6:07 ` [PATCH bpf-next 1/2] selftests/bpf: Move verifier failure tests out of test_global_percpu_data Leon Hwang
2026-09-07  5:46   ` Thiébaud Weksteen
2026-09-07 15:24     ` Leon Hwang [this message]
2026-09-08  1:04       ` Thiébaud Weksteen

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=534e5a3b-5160-4619-8b2e-27a81783e17f@linux.dev \
    --to=leon.hwang@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=qmo@kernel.org \
    --cc=shuah@kernel.org \
    --cc=sidnayyar@google.com \
    --cc=song@kernel.org \
    --cc=tweek@google.com \
    --cc=yonghong.song@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

all inboxes | Powered by JetHome®