BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Thiébaud Weksteen" <tweek@google.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf 2/3] bpftool: Reject non-autoload programs for light skeletons
Date: Wed, 25 Nov 2026 00:59:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-232309@kernel.org> (raw)
In-Reply-To: <20261125004911.3937193-3-tweek@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] bpftool: multi-line comment style in do_skeleton() violates BPF
  convention
--

commit 00c1d9ac900fa5925fd4c2012a8926354bce780d
Author: Thiébaud Weksteen <tweek@google.com>

bpftool: Reject non-autoload programs for light skeletons

This commit moves loader generation and object loading earlier in
do_skeleton() and rejects BPF programs marked as non-autoload when
generating light skeletons.

> diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
> index ee680f7c21160..edb6f7ef508ea 100644
> --- a/tools/bpf/bpftool/gen.c
> +++ b/tools/bpf/bpftool/gen.c

[ ... ]

> @@ -1316,6 +1301,29 @@ static int do_skeleton(int argc, char **argv)
>  		goto out_obj;
>  	}
>  
> +	/* If we are generating a loader, load the object early (before
> +	 * validating programs and emitting skeleton struct definitions), as
> +	 * bpf_object__load() may update a program's autoload status (e.g.
> +	 * for struct_ops programs).
> +	 */
> +	if (use_loader) {
> +		if (sign_progs)
> +			gen_opts.gen_hash = true;
> +
> +		err = bpf_object__gen_loader(obj, &gen_opts);
> +		if (err)
> +			goto out;
> +
> +		err = bpf_object__load(obj);
> +		if (err) {
> +			p_err("failed to load object file");
> +			goto out;
> +		}
> +		/* If there was no error during load, gen_opts is populated with
> +		 * the loader program.
> +		 */
> +	}

[Severity: Low]
This isn't a bug, but BPF coding style places the opening /* of multi-line
comments on its own line with the comment text starting on the next line.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125004911.3937193-1-tweek@google.com?part=2

  reply	other threads:[~2026-11-25  0:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  0:49 [PATCH bpf 0/3] bpftool: Reject non-autoload programs for light skeletons Thiébaud Weksteen
2026-11-25  0:49 ` [PATCH bpf 1/3] selftests/bpf: Move verifier failure tests out of test_global_percpu_data Thiébaud Weksteen
2026-11-25  0:49 ` [PATCH bpf 2/3] bpftool: Reject non-autoload programs for light skeletons Thiébaud Weksteen
2026-11-25  0:59   ` sashiko-bot [this message]
2026-11-25  0:49 ` [PATCH bpf 3/3] selftests/bpf: Test non-autoload rejection in " 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=sashiko-outbox-232309@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tweek@google.com \
    /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