<feed xmlns='http://www.w3.org/2005/Atom'>
<title>blaster4385/linux-IllusionX/tools/bpf, branch v6.12.1</title>
<subtitle>Linux kernel with personal config changes for arch linux</subtitle>
<id>https://git.tablaster.dev/blaster4385/linux-IllusionX/atom?h=v6.12.1</id>
<link rel='self' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/atom?h=v6.12.1'/>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/'/>
<updated>2024-09-10T18:40:55Z</updated>
<entry>
<title>bpftool: Fix undefined behavior in qsort(NULL, 0, ...)</title>
<updated>2024-09-10T18:40:55Z</updated>
<author>
<name>Kuan-Wei Chiu</name>
<email>visitorckw@gmail.com</email>
</author>
<published>2024-09-10T15:02:07Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=f04e2ad394e2755d0bb2d858ecb5598718bf00d5'/>
<id>urn:sha1:f04e2ad394e2755d0bb2d858ecb5598718bf00d5</id>
<content type='text'>
When netfilter has no entry to display, qsort is called with
qsort(NULL, 0, ...). This results in undefined behavior, as UBSan
reports:

net.c:827:2: runtime error: null pointer passed as argument 1, which is declared to never be null

Although the C standard does not explicitly state whether calling qsort
with a NULL pointer when the size is 0 constitutes undefined behavior,
Section 7.1.4 of the C standard (Use of library functions) mentions:

"Each of the following statements applies unless explicitly stated
otherwise in the detailed descriptions that follow: If an argument to a
function has an invalid value (such as a value outside the domain of
the function, or a pointer outside the address space of the program, or
a null pointer, or a pointer to non-modifiable storage when the
corresponding parameter is not const-qualified) or a type (after
promotion) not expected by a function with variable number of
arguments, the behavior is undefined."

To avoid this, add an early return when nf_link_info is NULL to prevent
calling qsort with a NULL pointer.

Signed-off-by: Kuan-Wei Chiu &lt;visitorckw@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20240910150207.3179306-1-visitorckw@gmail.com
</content>
</entry>
<entry>
<title>bpftool: Fix typos</title>
<updated>2024-09-09T22:57:52Z</updated>
<author>
<name>Andrew Kreimer</name>
<email>algonell@gmail.com</email>
</author>
<published>2024-09-09T09:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=f028d7716cdeae3be7d8d211482248916b25b1c2'/>
<id>urn:sha1:f028d7716cdeae3be7d8d211482248916b25b1c2</id>
<content type='text'>
Fix typos in documentation.

Reported-by: Matthew Wilcox &lt;willy@infradead.org&gt;
Reported-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Signed-off-by: Andrew Kreimer &lt;algonell@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20240909092452.4293-1-algonell@gmail.com
</content>
</entry>
<entry>
<title>bpftool: Fix undefined behavior caused by shifting into the sign bit</title>
<updated>2024-09-09T22:57:09Z</updated>
<author>
<name>Kuan-Wei Chiu</name>
<email>visitorckw@gmail.com</email>
</author>
<published>2024-09-08T14:00:09Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=4cdc0e4ce5e893bc92255f5f734d983012f2bc2e'/>
<id>urn:sha1:4cdc0e4ce5e893bc92255f5f734d983012f2bc2e</id>
<content type='text'>
Replace shifts of '1' with '1U' in bitwise operations within
__show_dev_tc_bpf() to prevent undefined behavior caused by shifting
into the sign bit of a signed integer. By using '1U', the operations
are explicitly performed on unsigned integers, avoiding potential
integer overflow or sign-related issues.

Signed-off-by: Kuan-Wei Chiu &lt;visitorckw@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20240908140009.3149781-1-visitorckw@gmail.com
</content>
</entry>
<entry>
<title>bpftool: Improve btf c dump sorting stability</title>
<updated>2024-09-06T21:06:30Z</updated>
<author>
<name>Mykyta Yatsenko</name>
<email>yatsenko@meta.com</email>
</author>
<published>2024-09-06T13:24:53Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=f8c6b7913dfaa67475883f94261c278adbcaa0ae'/>
<id>urn:sha1:f8c6b7913dfaa67475883f94261c278adbcaa0ae</id>
<content type='text'>
Existing algorithm for BTF C dump sorting uses only types and names of
the structs and unions for ordering. As dump contains structs with the
same names but different contents, relative to each other ordering of
those structs will be accidental.
This patch addresses this problem by introducing a new sorting field
that contains hash of the struct/union field names and types to
disambiguate comparison of the non-unique named structs.

Signed-off-by: Mykyta Yatsenko &lt;yatsenko@meta.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20240906132453.146085-1-mykyta.yatsenko5@gmail.com
</content>
</entry>
<entry>
<title>bpftool: fix some typos in bpftool</title>
<updated>2024-09-05T20:07:47Z</updated>
<author>
<name>Lin Yikai</name>
<email>yikai.lin@vivo.com</email>
</author>
<published>2024-09-05T11:03:06Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=a86857d2546c98f6c4e5677af8c6b8a80edd0704'/>
<id>urn:sha1:a86857d2546c98f6c4e5677af8c6b8a80edd0704</id>
<content type='text'>
Hi, fix some spelling errors in bpftool, the details are as follows:

-in file "bpftool-gen.rst"
	libppf-&gt;libbpf
-in the code comments:
	ouptut-&gt;output

Signed-off-by: Lin Yikai &lt;yikai.lin@vivo.com&gt;
Link: https://lore.kernel.org/r/20240905110354.3274546-2-yikai.lin@vivo.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpftool: Fix handling enum64 in btf dump sorting</title>
<updated>2024-09-02T20:44:51Z</updated>
<author>
<name>Mykyta Yatsenko</name>
<email>yatsenko@meta.com</email>
</author>
<published>2024-09-02T17:17:21Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=b0222d1d9e6f8551a056b89b0bff38f515f3c9b5'/>
<id>urn:sha1:b0222d1d9e6f8551a056b89b0bff38f515f3c9b5</id>
<content type='text'>
Wrong function is used to access the first enum64 element. Substituting btf_enum(t)
with btf_enum64(t) for BTF_KIND_ENUM64.

Fixes: 94133cf24bb3 ("bpftool: Introduce btf c dump sorting")
Signed-off-by: Mykyta Yatsenko &lt;yatsenko@meta.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20240902171721.105253-1-mykyta.yatsenko5@gmail.com
</content>
</entry>
<entry>
<title>bpftool: Add missing blank lines in bpftool-net doc example</title>
<updated>2024-09-02T16:25:16Z</updated>
<author>
<name>Quentin Monnet</name>
<email>qmo@kernel.org</email>
</author>
<published>2024-09-01T21:07:42Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=5d2784e25d7a6c216c9a4cbed2026febfb0c094c'/>
<id>urn:sha1:5d2784e25d7a6c216c9a4cbed2026febfb0c094c</id>
<content type='text'>
In bpftool-net documentation, two blank lines are missing in a
recently added example, causing docutils to complain:

    $ cd tools/bpf/bpftool
    $ make doc
      DESCEND Documentation
      GEN     bpftool-btf.8
      GEN     bpftool-cgroup.8
      GEN     bpftool-feature.8
      GEN     bpftool-gen.8
      GEN     bpftool-iter.8
      GEN     bpftool-link.8
      GEN     bpftool-map.8
      GEN     bpftool-net.8
    &lt;stdin&gt;:189: (INFO/1) Possible incomplete section title.
    Treating the overline as ordinary text because it's so short.
    &lt;stdin&gt;:192: (INFO/1) Blank line missing before literal block (after the "::")? Interpreted as a definition list item.
    &lt;stdin&gt;:199: (INFO/1) Possible incomplete section title.
    Treating the overline as ordinary text because it's so short.
    &lt;stdin&gt;:201: (INFO/1) Blank line missing before literal block (after the "::")? Interpreted as a definition list item.
      GEN     bpftool-perf.8
      GEN     bpftool-prog.8
      GEN     bpftool.8
      GEN     bpftool-struct_ops.8

Add the missing blank lines.

Fixes: 0d7c06125cea ("bpftool: Add document for net attach/detach on tcx subcommand")
Signed-off-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240901210742.25758-1-qmo@kernel.org
</content>
</entry>
<entry>
<title>tools/bpf: Fix the wrong format specifier</title>
<updated>2024-07-30T20:41:20Z</updated>
<author>
<name>Zhu Jun</name>
<email>zhujun2@cmss.chinamobile.com</email>
</author>
<published>2024-07-24T11:11:20Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=781f0bbbdade00f91490a3f64212e8cc8d75905c'/>
<id>urn:sha1:781f0bbbdade00f91490a3f64212e8cc8d75905c</id>
<content type='text'>
The format specifier of "unsigned int" in printf() should be "%u", not
"%d".

Signed-off-by: Zhu Jun &lt;zhujun2@cmss.chinamobile.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20240724111120.11625-1-zhujun2@cmss.chinamobile.com
</content>
</entry>
<entry>
<title>tools/runqslower: Fix LDFLAGS and add LDLIBS support</title>
<updated>2024-07-29T22:05:05Z</updated>
<author>
<name>Tony Ambardar</name>
<email>tony.ambardar@gmail.com</email>
</author>
<published>2024-07-23T00:30:45Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=f86601c3661946721e8f260bdd812b759854ac22'/>
<id>urn:sha1:f86601c3661946721e8f260bdd812b759854ac22</id>
<content type='text'>
Actually use previously defined LDFLAGS during build and add support for
LDLIBS to link extra standalone libraries e.g. 'argp' which is not provided
by musl libc.

Fixes: 585bf4640ebe ("tools: runqslower: Add EXTRA_CFLAGS and EXTRA_LDFLAGS support")
Signed-off-by: Tony Ambardar &lt;tony.ambardar@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Link: https://lore.kernel.org/bpf/20240723003045.2273499-1-tony.ambardar@gmail.com
</content>
</entry>
<entry>
<title>bpftool: Add document for net attach/detach on tcx subcommand</title>
<updated>2024-07-29T19:54:08Z</updated>
<author>
<name>Tao Chen</name>
<email>chen.dylane@gmail.com</email>
</author>
<published>2024-07-21T14:42:52Z</published>
<link rel='alternate' type='text/html' href='https://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=0d7c06125cea53b3d86d685d790b03b9ae9d6336'/>
<id>urn:sha1:0d7c06125cea53b3d86d685d790b03b9ae9d6336</id>
<content type='text'>
This commit adds sample output for net attach/detach on
tcx subcommand.

Signed-off-by: Tao Chen &lt;chen.dylane@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Quentin Monnet &lt;qmo@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20240721144252.96264-1-chen.dylane@gmail.com
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
</content>
</entry>
</feed>
