<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/lib/bpf, branch v6.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-08-07T16:01:41Z</updated>
<entry>
<title>libbpf: Add the ability to suppress perf event enablement</title>
<updated>2025-08-07T16:01:41Z</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2025-08-06T16:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9474e27a24a41e55d0ac2b77d8171fddec7dbb87'/>
<id>urn:sha1:9474e27a24a41e55d0ac2b77d8171fddec7dbb87</id>
<content type='text'>
Automatically enabling a perf event after attaching a BPF prog to it is
not always desirable.

Add a new "dont_enable" field to struct bpf_perf_event_opts. While
introducing "enable" instead would be nicer in that it would avoid
a double negation in the implementation, it would make
DECLARE_LIBBPF_OPTS() less efficient.

Acked-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Suggested-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Tested-by: Thomas Richter &lt;tmricht@linux.ibm.com&gt;
Co-developed-by: Thomas Richter &lt;tmricht@linux.ibm.com&gt;
Signed-off-by: Thomas Richter &lt;tmricht@linux.ibm.com&gt;
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20250806162417.19666-2-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;

</content>
</entry>
<entry>
<title>libbpf: Avoid possible use of uninitialized mod_len</title>
<updated>2025-07-31T18:39:46Z</updated>
<author>
<name>Achill Gilgenast</name>
<email>fossdd@pwned.life</email>
</author>
<published>2025-07-29T09:45:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13cb75730b7a8b2dc8fe32874e159b2c7b75efde'/>
<id>urn:sha1:13cb75730b7a8b2dc8fe32874e159b2c7b75efde</id>
<content type='text'>
Though mod_len is only read when mod_name != NULL and both are initialized
together, gcc15 produces a warning with -Werror=maybe-uninitialized:

libbpf.c: In function 'find_kernel_btf_id.constprop':
libbpf.c:10100:33: error: 'mod_len' may be used uninitialized [-Werror=maybe-uninitialized]
10100 |                 if (mod_name &amp;&amp; strncmp(mod-&gt;name, mod_name, mod_len) != 0)
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libbpf.c:10070:21: note: 'mod_len' was declared here
10070 |         int ret, i, mod_len;
      |                     ^~~~~~~

Silence the false positive.

Signed-off-by: Achill Gilgenast &lt;fossdd@pwned.life&gt;
Acked-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Acked-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Link: https://lore.kernel.org/r/20250729094611.2065713-1-fossdd@pwned.life
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: Verify that arena map exists when adding arena relocations</title>
<updated>2025-07-19T00:12:50Z</updated>
<author>
<name>Eduard Zingerman</name>
<email>eddyz87@gmail.com</email>
</author>
<published>2025-07-18T22:20:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=42be23e8f2dcb100cb9944b2b54b6bf41aff943d'/>
<id>urn:sha1:42be23e8f2dcb100cb9944b2b54b6bf41aff943d</id>
<content type='text'>
Fuzzer reported a memory access error in bpf_program__record_reloc()
that happens when:
- ".addr_space.1" section exists
- there is a relocation referencing this section
- there are no arena maps defined in BTF.

Sanity checks for maps existence are already present in
bpf_program__record_reloc(), hence this commit adds another one.

[1] https://github.com/libbpf/libbpf/actions/runs/16375110681/job/46272998064

Signed-off-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20250718222059.281526-1-eddyz87@gmail.com
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after rc6</title>
<updated>2025-07-18T19:15:59Z</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@kernel.org</email>
</author>
<published>2025-07-18T19:14:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=beb1097ec8bdf15e2fed3301920a719e0dd2250a'/>
<id>urn:sha1:beb1097ec8bdf15e2fed3301920a719e0dd2250a</id>
<content type='text'>
Cross-merge BPF and other fixes after downstream PR.

No conflicts.

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: Fix warning in calloc() usage</title>
<updated>2025-07-18T15:29:50Z</updated>
<author>
<name>Matteo Croce</name>
<email>teknoraver@meta.com</email>
</author>
<published>2025-07-17T20:03:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0ee30d937c147fc14c4b49535181d437cd2fde7a'/>
<id>urn:sha1:0ee30d937c147fc14c4b49535181d437cd2fde7a</id>
<content type='text'>
When compiling libbpf with some compilers, this warning is triggered:

libbpf.c: In function ‘bpf_object__gen_loader’:
libbpf.c:9209:28: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
 9209 |         gen = calloc(sizeof(*gen), 1);
      |                            ^
libbpf.c:9209:28: note: earlier argument should specify number of elements, later size of each element

Fix this by inverting the calloc() arguments.

Signed-off-by: Matteo Croce &lt;teknoraver@meta.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Link: https://lore.kernel.org/bpf/20250717200337.49168-1-technoboy85@gmail.com
</content>
</entry>
<entry>
<title>libbpf: Fix handling of BPF arena relocations</title>
<updated>2025-07-18T02:17:46Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2025-07-18T00:10:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0238c45fbbf8228f52aa4642f0cdc21c570d1dfe'/>
<id>urn:sha1:0238c45fbbf8228f52aa4642f0cdc21c570d1dfe</id>
<content type='text'>
Initial __arena global variable support implementation in libbpf
contains a bug: it remembers struct bpf_map pointer for arena, which is
used later on to process relocations. Recording this pointer is
problematic because map pointers are not stable during ELF relocation
collection phase, as an array of struct bpf_map's can be reallocated,
invalidating all the pointers. Libbpf is dealing with similar issues by
using a stable internal map index, though for BPF arena map specifically
this approach wasn't used due to an oversight.

The resulting behavior is non-deterministic issue which depends on exact
layout of ELF object file, number of actual maps, etc. We didn't hit
this until very recently, when this bug started triggering crash in BPF
CI when validating one of sched-ext BPF programs.

The fix is rather straightforward: we just follow an established pattern
of remembering map index (just like obj-&gt;kconfig_map_idx, for example)
instead of `struct bpf_map *`, and resolving index to a pointer at the
point where map information is necessary.

While at it also add debug-level message for arena-related relocation
resolution information, which we already have for all other kinds of
maps.

Fixes: 2e7ba4f8fd1f ("libbpf: Recognize __arena global variables.")
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Tested-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Link: https://lore.kernel.org/r/20250718001009.610955-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: start v1.7 dev cycle</title>
<updated>2025-07-17T01:37:27Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2025-07-16T17:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8080500cba05d057dc6cfe4b6afbaf026eb2dd06'/>
<id>urn:sha1:8080500cba05d057dc6cfe4b6afbaf026eb2dd06</id>
<content type='text'>
With libbpf 1.6.0 released, adjust libbpf.map and libbpf_version.h to
start v1.7 development cycles.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Link: https://lore.kernel.org/r/20250716175936.2343013-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: __arg_untrusted in bpf_helpers.h</title>
<updated>2025-07-07T15:25:07Z</updated>
<author>
<name>Eduard Zingerman</name>
<email>eddyz87@gmail.com</email>
</author>
<published>2025-07-04T23:03:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aaa0e57e693083b997f21064689710dfe98b326c'/>
<id>urn:sha1:aaa0e57e693083b997f21064689710dfe98b326c</id>
<content type='text'>
Make btf_decl_tag("arg:untrusted") available for libbpf users via
macro. Makes the following usage possible:

  void foo(struct bar *p __arg_untrusted) { ... }
  void bar(struct foo *p __arg_trusted) {
    ...
    foo(p-&gt;buz-&gt;bar); // buz derefrence looses __trusted
    ...
  }

Acked-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Signed-off-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Link: https://lore.kernel.org/r/20250704230354.1323244-6-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: Introduce bpf_prog_stream_read() API</title>
<updated>2025-07-04T02:30:07Z</updated>
<author>
<name>Kumar Kartikeya Dwivedi</name>
<email>memxor@gmail.com</email>
</author>
<published>2025-07-03T20:48:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3bbc1ba9cc0d9a7ccc194883489a4e460ca5080b'/>
<id>urn:sha1:3bbc1ba9cc0d9a7ccc194883489a4e460ca5080b</id>
<content type='text'>
Introduce a libbpf API so that users can read data from a given BPF
stream for a BPF prog fd. For now, only the low-level syscall wrapper
is provided, we can add a bpf_program__* accessor as a follow up if
needed.

Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Signed-off-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Link: https://lore.kernel.org/r/20250703204818.925464-11-memxor@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>libbpf: Add bpf_stream_printk() macro</title>
<updated>2025-07-04T02:30:07Z</updated>
<author>
<name>Kumar Kartikeya Dwivedi</name>
<email>memxor@gmail.com</email>
</author>
<published>2025-07-03T20:48:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=21a3afc76a317b9fb214c5afcfd5e1587b2ae9b3'/>
<id>urn:sha1:21a3afc76a317b9fb214c5afcfd5e1587b2ae9b3</id>
<content type='text'>
Add a convenience macro to print data to the BPF streams. BPF_STDOUT and
BPF_STDERR stream IDs in the vmlinux.h can be passed to the macro to
print to the respective streams.

Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Signed-off-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Link: https://lore.kernel.org/r/20250703204818.925464-10-memxor@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
