From: Eduard Zingerman <eddyz87@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
martin.lau@kernel.org
Cc: kernel-team@meta.com, Mykyta Yatsenko <yatsenko@meta.com>
Subject: Re: [PATCH bpf-next 2/2] libbpf: fix BPF skeleton forward/backward compat handling
Date: Thu, 04 Jul 2024 13:51:05 -0700 [thread overview]
Message-ID: <11196cc77173e29588e93078bd74a9ae9d8463e5.camel@gmail.com> (raw)
In-Reply-To: <20240704001527.754710-3-andrii@kernel.org>
On Wed, 2024-07-03 at 17:15 -0700, Andrii Nakryiko wrote:
> BPF skeleton was designed from day one to be extensible. Generated BPF
> skeleton code specifies actual sizes of map/prog/variable skeletons for
> that reason and libbpf is supposed to work with newer/older versions
> correctly.
>
> Unfortunately, it was missed that we implicitly embed hard-coded most
> up-to-date (according to libbpf's version of libbpf.h header used to
> compile BPF skeleton header) sizes of those strucs, which can differ
^^
nit: "struct"
> from the actual sizes at runtime when libbpf is used as a shared
> library.
>
> We have a few places were we just index array of maps/progs/vars, which
> implicitly uses these potentially invalid sizes of structs.
>
> This patch aims to fix this problem going forward. Once this lands,
> we'll backport these changes in Github repo to create patched releases
> for older libbpfs.
>
> Fixes: d66562fba1ce ("libbpf: Add BPF object skeleton support")
> Fixes: 430025e5dca5 ("libbpf: Add subskeleton scaffolding")
> Co-developed-by: Mykyta Yatsenko <yatsenko@meta.com>
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
> ---
I double-checked all uses of bpf_object_skeleton->{maps,progs},
all seems in order.
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
[...]
prev parent reply other threads:[~2024-07-04 20:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 0:15 [PATCH bpf-next 0/2] Fix libbpf BPF skeleton forward/backward compat Andrii Nakryiko
2024-07-04 0:15 ` [PATCH bpf-next 1/2] bpftool: improve skeleton backwards compat with old buggy libbpfs Andrii Nakryiko
2024-07-04 19:21 ` Quentin Monnet
2024-07-08 17:14 ` Andrii Nakryiko
2024-07-04 20:31 ` Eduard Zingerman
2024-07-08 17:15 ` Andrii Nakryiko
2024-07-08 17:53 ` Eduard Zingerman
2024-07-04 0:15 ` [PATCH bpf-next 2/2] libbpf: fix BPF skeleton forward/backward compat handling Andrii Nakryiko
2024-07-04 15:16 ` Alan Maguire
2024-07-04 20:56 ` Eduard Zingerman
2024-07-08 17:19 ` Andrii Nakryiko
2024-07-08 17:19 ` Andrii Nakryiko
2024-07-04 20:51 ` Eduard Zingerman [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=11196cc77173e29588e93078bd74a9ae9d8463e5.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
--cc=yatsenko@meta.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