Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 02779af2 authored by Alexei Starovoitov's avatar Alexei Starovoitov
Browse files

Merge branch 'fix-libbpf-bpf-skeleton-forward-backward-compat'

Andrii Nakryiko says:

====================
Fix libbpf BPF skeleton forward/backward compat

Fix recently identified (but long standing) bug with handling BPF skeleton
forward and backward compatibility. On libbpf side, even though BPF skeleton
was always designed to be forward and backwards compatible through recording
actual size of constrituents of BPF skeleton itself (map/prog/var skeleton
definitions), libbpf implementation did implicitly hard-code those sizes by
virtue of using a trivial array access syntax.

This issue will only affect libbpf used as a shared library. Statically
compiled libbpfs will always be in sync with BPF skeleton, bypassing this
problem altogether.

This patch set fixes libbpf, but also mitigates the problem for old libbpf
versions by teaching bpftool to generate more conservative BPF skeleton,
if possible (i.e., if there are no struct_ops maps defined).

v1->v2:
  - fix SOB, add acks, typo fixes (Quentin, Eduard);
  - improve reporting of skipped map auto-attachment (Alan, Eduard).
====================

Link: https://lore.kernel.org/r/20240708204540.4188946-1-andrii@kernel.org


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parents 746d684e a459f4bb
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment