Skip to content

Conversation

@qmonnet
Copy link
Member

@qmonnet qmonnet commented Jul 2, 2025

Pull latest libbpf from mirror and sync bpftool repo with kernel, up to the commits used for libbpf sync. This is an automatic update performed by calling the sync script from this repo:

$ ./scripts/sync-kernel.sh . <path/to/>linux

slava-at-cs and others added 5 commits June 21, 2025 01:18
Modify several functions in tools/bpf/bpftool/common.c to allow
specification of requested access for file descriptors, such as
read-only access.

Update bpftool to request only read access for maps when write
access is not required. This fixes errors when reading from maps
that are protected from modification via security_bpf_map.

Signed-off-by: Slava Imameev <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
In function dump_xx_nlmsg(), when realloc() fails to allocate memory,
the original pointer to the buffer is overwritten with NULL. This causes
a memory leak because the previously allocated buffer becomes unreachable
without being freed.

Fixes: 7900efc19214 ("tools/bpf: bpftool: improve output format for bpftool net")
Signed-off-by: Yuan Chen <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Pull latest libbpf from mirror.
Libbpf version: 1.6.0
Libbpf commit:  5e3306e89a44cab09693ce4bfe50bfc0cb595941

Signed-off-by: Quentin Monnet <[email protected]>
When using `bpftool --version -j/-p`, the JSON writer object
created in do_version() was not properly destroyed after use.
This caused a memory leak each time the version command was
executed with JSON output.

Fix: 004b45c0e51a (tools: bpftool: provide JSON output for all possible commands)

Suggested-by: Quentin Monnet <[email protected]>
Signed-off-by: Yuan Chen <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Syncing latest bpftool commits from kernel repository.
Baseline bpf-next commit:   4a4b84ba9e453295c746d81cb245c0c5d80050f0
Checkpoint bpf-next commit: 212ec92295673a362453f8ede36033b61c7983fa
Baseline bpf commit:        ad9ef7f687ceae6d0564657e0e0045dc6e067a6c
Checkpoint bpf commit:      e34a79b96ab9d49ed8b605fee11099cf3efbb428

Slava Imameev (1):
  bpftool: Use appropriate permissions for map access

Yuan Chen (2):
  bpftool: Fix JSON writer resource leak in version command
  bpftool: Fix memory leak in dump_xx_nlmsg on realloc failure

 src/btf.c           |  8 ++++--
 src/common.c        | 59 +++++++++++++++++++++++++++++++++------------
 src/iter.c          |  2 +-
 src/link.c          |  2 +-
 src/main.c          |  6 ++---
 src/main.h          | 13 ++++++----
 src/map.c           | 56 ++++++++++++++++++++++++------------------
 src/map_perf_ring.c |  3 ++-
 src/net.c           | 15 +++++++-----
 src/prog.c          |  4 +--
 10 files changed, 108 insertions(+), 60 deletions(-)

Signed-off-by: Quentin Monnet <[email protected]>
@qmonnet qmonnet merged commit 5b402ff into libbpf:main Jul 2, 2025
5 of 7 checks passed
@qmonnet qmonnet deleted the bpftool-sync-2025-07-02T12-27-41.440Z branch July 2, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants