From: sashiko-bot@kernel.org
To: "Andrey Grodzovsky" <andrey.grodzovsky@crowdstrike.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 5/7] libbpf: Version bpf_program__set_autoattach() ABI change
Date: Mon, 21 Sep 2026 23:31:21 +0000 [thread overview]
Message-ID: <20260921233122.12D7F1F0089C@smtp.kernel.org> (raw)
In-Reply-To: <20260921223937.3203093-6-andrey.grodzovsky@crowdstrike.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] libbpf: internal versioned aliases improperly exposed in public ABI
--
commit f4a1074a0b47562f2c3d7f448c920fa57fb2ed38
Author: Andrey Grodzovsky <andrey.grodzovsky@crowdstrike.com>
libbpf: Version bpf_program__set_autoattach() ABI change
This commit splits bpf_program__set_autoattach() via ELF symbol versioning.
It introduces a deprecated variant bound to LIBBPF_1.0.0 and a new variant
returning int bound to LIBBPF_1.8.0 to handle manual load strategy rejections.
> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> --- a/tools/lib/bpf/libbpf.h
> +++ b/tools/lib/bpf/libbpf.h
> @@ -393,6 +393,12 @@ LIBBPF_API bool bpf_program__autoload(const struct bpf_program *prog);
> LIBBPF_API int bpf_program__set_autoload(struct bpf_program *prog, bool autoload);
> LIBBPF_API bool bpf_program__autoattach(const struct bpf_program *prog);
> LIBBPF_API int bpf_program__set_autoattach(struct bpf_program *prog, bool autoattach);
> +/* this "specialization" should go away once the deprecation window for
> + * bpf_program__set_autoattach_deprecated() closes
> + */
> +LIBBPF_API int bpf_program__set_autoattach_v1_8_0(struct bpf_program *prog, bool autoattach);
> +LIBBPF_DEPRECATED_SINCE(1, 8, "use int-returning bpf_program__set_autoattach() instead")
> +LIBBPF_API void bpf_program__set_autoattach_deprecated(struct bpf_program *prog, bool autoattach);
[Severity: Medium]
Does exposing these internal versioned aliases in the public header
defeat the purpose of transparent ELF versioning?
Building any application against this updated header might expose these
internal symbols, and dynamic linking could permanently bind them to the
polluted ABI.
Additionally, because the deprecation macro is attached to the internal alias
rather than the standard name, will users ever see the deprecation warning
naturally when they call bpf_program__set_autoattach()?
[ ... ]
> diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
> --- a/tools/lib/bpf/libbpf.map
> +++ b/tools/lib/bpf/libbpf.map
> @@ -465,6 +465,8 @@ LIBBPF_1.8.0 {
> bpf_program__clone;
> bpf_program__load;
> bpf_program__load_strategy;
> + bpf_program__set_autoattach;
> + bpf_program__set_autoattach_deprecated;
[Severity: Medium]
Is it intended to export the internal compat implementation as a public
symbol in the new LIBBPF_1.8.0 namespace?
This appears to permanently leak the internal compatibility symbol into the
public ABI.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921223937.3203093-1-andrey.grodzovsky@crowdstrike.com?part=5
next prev parent reply other threads:[~2026-09-21 23:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 22:39 [PATCH bpf-next v4 0/7] libbpf: BPF program manual loading Andrey Grodzovsky
2026-09-21 22:39 ` [PATCH bpf-next v4 1/7] libbpf: BPF program load strategy enum Andrey Grodzovsky
2026-09-21 23:21 ` bot+bpf-ci
2026-09-21 22:39 ` [PATCH bpf-next v4 2/7] libbpf: BPF programs manual loading and attaching Andrey Grodzovsky
2026-09-21 23:03 ` sashiko-bot
2026-09-22 23:51 ` Andrey Grodzovsky
2026-09-21 22:39 ` [PATCH bpf-next v4 3/7] libbpf: Support declarative manual load via SEC("!...") prefix Andrey Grodzovsky
2026-09-21 23:12 ` sashiko-bot
2026-09-21 23:21 ` bot+bpf-ci
2026-09-21 22:39 ` [PATCH bpf-next v4 4/7] libbpf: Reject gen_loader for objects with already-manual programs Andrey Grodzovsky
2026-09-21 22:39 ` [PATCH bpf-next v4 5/7] libbpf: Version bpf_program__set_autoattach() ABI change Andrey Grodzovsky
2026-09-21 23:31 ` sashiko-bot [this message]
2026-09-21 22:39 ` [PATCH bpf-next v4 6/7] selftests/bpf: Cover BPF program load strategy transitions Andrey Grodzovsky
2026-09-21 23:37 ` sashiko-bot
2026-09-21 22:39 ` [PATCH bpf-next v4 7/7] selftests/bpf: Cover BPF program manual loading Andrey Grodzovsky
2026-09-22 1:37 ` [PATCH bpf-next v4 0/7] libbpf: " Alexei Starovoitov
2026-09-22 14:34 ` Andrey Grodzovsky
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=20260921233122.12D7F1F0089C@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=andrey.grodzovsky@crowdstrike.com \
--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