Fix libbpf BPF skeleton forward/backward compat
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 4 repliesApplied 3/3
- v12 patches 10 repliesSuperseded
Changes in v2 from the cover letter
- fix SOB, add acks, typo fixes (Quentin, Eduard);
- improve reporting of skipped map auto-attachment (Alan, Eduard).
Patches in v2 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | bpftool: improve skeleton backwards compat with old buggy libbpfstools/ | +32 | 3 replies | Applied |
| 2/3 | libbpf: fix BPF skeleton forward/backward compat handlingtools/ | +27 | 0 replies | Applied |
| 3/3 | libbpf: improve old BPF skeleton handling for map auto-attachtools/ | +14 | 1 reply | Applied |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Quentin Monnet | Eduard Zingerman | Alan Maguire |
|---|---|---|---|
| 1/3 | A-b | A-b | |
| 2/3 | A-b | R-b | |
| 3/3 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 bpf-next 0/3] 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).
Andrii Nakryiko (3):
bpftool: improve skeleton backwards compat with old buggy libbpfs
libbpf: fix BPF skeleton forward/backward compat handling
libbpf: improve old BPF skeleton handling for map auto-attach
tools/bpf/bpftool/gen.c | 46 ++++++++++++++++++-------- tools/lib/bpf/libbpf.c | 71 +++++++++++++++++++++++------------------ 2 files changed, 72 insertions(+), 45 deletions(-)
Signature · 1 line
2.43.0