Commit Graph
21 Commits
Author SHA1 Message Date
Ihor Solodrai f5dcbae736 sync: latest libbpf changes from kernel
Syncing latest libbpf commits from kernel repository.
Baseline bpf-next commit:   d7988720ef3ea5926f1b886b27eddf08abbadba0
Checkpoint bpf-next commit: ca0f39a369c5f927c3d004e63a5a778b08a9df94
Baseline bpf commit:        593fffb8bcfdacc2111a9951afe1fae77988aa4a
Checkpoint bpf commit:      e06e6b8001233241eb5b2e2791162f0585f50f4b

Andrey Grodzovsky (1):
  libbpf: Optimize kprobe.session attachment for exact function names

Ihor Solodrai (1):
  libbpf: Remove extern declaration of bpf_stream_vprintk()

Jakub Kicinski (1):
  bpftool: Fix truncated netlink dumps

Jiri Olsa (2):
  libbpf: Add uprobe syscall feature detection
  libbpf: Add support to detect nop,nop5 instructions combo for usdt
    probe

Josef Bacik (1):
  libbpf: Support appending split BTF in btf__add_btf()

 src/bpf_helpers.h     |  3 ---
 src/btf.c             | 27 ++++++++++++++++---------
 src/features.c        | 24 ++++++++++++++++++++++
 src/libbpf.c          | 19 ++++++++++++++++-
 src/libbpf_internal.h |  2 ++
 src/netlink.c         |  4 +++-
 src/usdt.c            | 47 +++++++++++++++++++++++++++++++++++++++----
 7 files changed, 108 insertions(+), 18 deletions(-)

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-12 13:02:22 -07:00
Ihor Solodrai 8bf68faba8 sync: update .mailmap
Update .mailmap based on libbpf's list of contributors and on the latest
.mailmap version in the upstream repository.

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-12 13:02:22 -07:00
Ihor Solodrai cc7760ce9a libbpf: Remove extern declaration of bpf_stream_vprintk()
An issue was reported that building BPF program which includes both
vmlinux.h and bpf_helpers.h from libbpf fails due to conflicting
declarations of bpf_stream_vprintk().

Remove the extern declaration from bpf_helpers.h to address this.

In order to use bpf_stream_printk() macro, BPF programs are expected
to either include vmlinux.h of the kernel they are targeting, or add
their own extern declaration.

Reported-by: Luca Boccassi <luca.boccassi@gmail.com>
Closes: https://github.com/libbpf/libbpf/issues/947
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260218215651.2057673-3-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-03-12 13:02:22 -07:00
Ihor Solodrai 6314de34ef Update checkpoint commit due to upstream rebase
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-12 13:02:22 -07:00
Ihor Solodrai bacf439175 ci/diffs: Add a patch fixing up bpftool_helpers.c
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-12 13:02:22 -07:00
Ihor Solodrai eca706a5e1 ci: fix concurrency group for push and schedule triggers
github.head_ref is empty for push and schedule events, so all those
runs shared the same concurrency group and cancelled each other. Fall
back to github.run_id to give each non-PR run a unique group.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-11 18:35:55 -07:00
Ihor Solodrai ac0952761f ci: run vmtest job inside kbuilder-debian container
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-11 18:35:55 -07:00
Ihor Solodrai 6b9b5e34b1 ci: remove LATEST kernel handling from vmtest
The libbpf CI always builds the kernel from source at CHECKPOINT-COMMIT;
there is no prebuilt-kernel matrix entry. Remove the `kernel` input and
the conditional build-vs-download logic, simplifying the workflow.

The run-vmtest action defaults KERNEL to "LATEST" internally when the
env var is unset, so DENYLIST-LATEST is still picked up. The vmlinuz
path is auto-discovered via `make -s image_name` when not passed.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-11 18:35:55 -07:00
Ihor Solodrai 09ae947cd8 ci: consolidate and clean up denylists
Merge DENYLIST-LATEST into DENYLIST and remove the per-kernel denylist
files. With LATEST being the only kernel mode, there's no need for
separate files. Also remove the s390x denylist (libbpf CI only tests
x86_64) and drop stale entries fixed upstream.

Add map_kptr, test_profiler (kprobes not available in VM kernel), and
sockmap udp multi channels (flaky) based on CI run results.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-11 18:35:55 -07:00
Ihor Solodrai b57c0a1b38 ci: update libbpf/ci action references from v3 to v4
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-11 18:35:55 -07:00
Ihor Solodrai f0b6d8cd49 ci: remove stale patches from ci/diffs
All 4 patches either fail to apply (context mismatch) or are already
applied upstream. They produce noise in CI logs.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2026-03-11 18:35:55 -07:00
Ihor Solodrai 977b1f820c bpf: Migrate bpf_stream_vprintk() to KF_IMPLICIT_ARGS
Implement bpf_stream_vprintk with an implicit bpf_prog_aux argument,
and remote bpf_stream_vprintk_impl from the kernel.

Update the selftests to use the new API with implicit argument.

bpf_stream_vprintk macro is changed to use the new bpf_stream_vprintk
kfunc, and the extern definition of bpf_stream_vprintk_impl is
replaced accordingly.

Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260120222638.3976562-11-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-01-29 14:10:19 -08:00
Ihor Solodrai 02bc656f90 libbpf: Verify section type in btf_find_elf_sections
A valid ELF file may contain a SHT_NOBITS .BTF section. This case is
not handled correctly in btf_parse_elf, which leads to a segfault.

Before attempting to load BTF section data, check that the section
type is SHT_PROGBITS, which is the expected type for BTF data.  Fail
with an error if the type is different.

Bug report: https://github.com/libbpf/libbpf/issues/894
v1: https://lore.kernel.org/bpf/20250408184104.3962949-1-ihor.solodrai@linux.dev/

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250410182823.1591681-1-ihor.solodrai@linux.dev
2025-04-29 11:33:37 -07:00
Ihor Solodrai 1b8768339f ci: add temporary patches for selftests
* https://lore.kernel.org/all/20250327185528.1740787-1-song@kernel.org/
* https://lore.kernel.org/bpf/20250328193124.808784-1-song@kernel.org/
* https://lore.kernel.org/bpf/20250331033828.365077-1-yonghong.song@linux.dev/

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2025-04-02 10:23:23 -07:00
Ihor Solodrai 374036c9f1 sync: latest libbpf changes from kernel
Syncing latest libbpf commits from kernel repository.
Baseline bpf-next commit:   239860828f8660e2be487e2fbdae2640cce3fd67
Checkpoint bpf-next commit: 79d93c8ff35855d3283ee7d82dfe0c54f90b9986
Baseline bpf commit:        319fc77f8f45a1b3dba15b0cc1a869778fd222f7
Checkpoint bpf commit:      6ccf6adb05d0fe3dbb1a77ab90bf054da8a2198d

Ihor Solodrai (1):
  libbpf: Implement bpf_usdt_arg_size BPF function

Mykyta Yatsenko (3):
  libbpf: Use map_is_created helper in map setters
  libbpf: Introduce more granular state for bpf_object
  libbpf: Split bpf object load into prepare/load

Nandakumar Edamana (1):
  libbpf: Fix out-of-bound read

Peilin Ye (1):
  bpf: Introduce load-acquire and store-release instructions

Yonghong Song (1):
  bpf: Allow pre-ordering for bpf cgroup progs

 include/uapi/linux/bpf.h |   4 +
 src/libbpf.c             | 201 ++++++++++++++++++++++++++-------------
 src/libbpf.h             |  13 +++
 src/libbpf.map           |   1 +
 src/usdt.bpf.h           |  32 +++++++
 5 files changed, 183 insertions(+), 68 deletions(-)

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2025-03-10 15:35:17 -07:00
Ihor Solodrai be18fdb16a libbpf: Implement bpf_usdt_arg_size BPF function
Information about USDT argument size is implicitly stored in
__bpf_usdt_arg_spec, but currently it's not accessbile to BPF programs
that use USDT.

Implement bpf_sdt_arg_size() that returns the size of an USDT argument
in bytes.

v1->v2:
  * do not add __bpf_usdt_arg_spec() helper

v1: https://lore.kernel.org/bpf/20250220215904.3362709-1-ihor.solodrai@linux.dev/

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20250224235756.2612606-1-ihor.solodrai@linux.dev
2025-03-10 15:35:17 -07:00
Ihor Solodrai 42a6ef6316 sync: latest libbpf changes from kernel
Syncing latest libbpf commits from kernel repository.
Baseline bpf-next commit:   01f3ce5328c405179b2c69ea047c423dad2bfa6d
Checkpoint bpf-next commit: 239860828f8660e2be487e2fbdae2640cce3fd67
Baseline bpf commit:        c45323b7560ec87c37c729b703c86ee65f136d75
Checkpoint bpf commit:      319fc77f8f45a1b3dba15b0cc1a869778fd222f7

Andrii Nakryiko (2):
  libbpf: fix LDX/STX/ST CO-RE relocation size adjustment logic
  libbpf: Fix hypothetical STT_SECTION extern NULL deref case

Daniel Borkmann (1):
  netkit: Allow for configuring needed_{head,tail}room

Ihor Solodrai (3):
  libbpf: Introduce kflag for type_tags and decl_tags in BTF
  docs/bpf: Document the semantics of BTF tags with kind_flag
  libbpf: Check the kflag of type tags in btf_dump

Tao Chen (1):
  libbpf: Wrap libbpf API direct err with libbpf_err

Tony Ambardar (1):
  libbpf: Fix accessing BTF.ext core_relo header

Yonghong Song (1):
  bpf: Sync uapi bpf.h header for the tooling infra

 include/uapi/linux/bpf.h     |  5 +-
 include/uapi/linux/btf.h     |  3 +-
 include/uapi/linux/if_link.h |  2 +
 src/btf.c                    | 90 ++++++++++++++++++++++++++----------
 src/btf.h                    |  3 ++
 src/btf_dump.c               |  5 +-
 src/libbpf.c                 | 26 +++++------
 src/libbpf.map               |  2 +
 src/linker.c                 |  2 +-
 src/relo_core.c              | 24 ++++++++--
 10 files changed, 116 insertions(+), 46 deletions(-)

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2025-02-24 15:10:59 -08:00
Ihor Solodrai cc278ff7c0 libbpf: Check the kflag of type tags in btf_dump
If the kflag is set for a BTF type tag, then the tag represents an
arbitrary __attribute__. Change btf_dump accordingly.

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250130201239.1429648-4-ihor.solodrai@linux.dev
2025-02-24 15:10:59 -08:00
Ihor Solodrai 2b8b896bca docs/bpf: Document the semantics of BTF tags with kind_flag
Explain the meaning of kind_flag in BTF type_tags and decl_tags.
Update uapi btf.h kind_flag comment to reflect the changes.

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250130201239.1429648-3-ihor.solodrai@linux.dev
2025-02-24 15:10:59 -08:00
Ihor Solodrai 32bda80136 libbpf: Introduce kflag for type_tags and decl_tags in BTF
Add the following functions to libbpf API:
  * btf__add_type_attr()
  * btf__add_decl_attr()

These functions allow to add to BTF the type tags and decl tags with
info->kflag set to 1. The kflag indicates that the tag directly
encodes an __attribute__ and not a normal tag.

See Documentation/bpf/btf.rst changes in the subsequent patch for
details on the semantics.

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250130201239.1429648-2-ihor.solodrai@linux.dev
2025-02-24 15:10:59 -08:00
Ihor Solodrai d4a841a32b ci: remove dependency on run-on-arch-action
run-on-arch-action is simply a wrapper around docker. There is no
value in using it in libbpf, as it is not complicated to run
non-native arch docker images directly on github-hosted runners.

Docker relies on qemu-user-static installed on the system to emulate
different architectures.

Recently there were various reports about multi-arch docker builds
failing with seemingly random issues, and it appears to boil down to
qemu [1]. I stumbled on this problem while updating s390x runners [2]
for BPF CI, and setting up more recent version of qemu helped.

This change addresses recent build failures on s390x and ppc64le.

[1] https://github.com/docker/setup-qemu-action/issues/188
[2] https://github.com/kernel-patches/runner/pull/69
[3] https://docs.docker.com/build/buildkit/#getting-started

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
2025-01-31 22:30:52 -08:00