<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/samples/bpf/syscall_tp_user.c, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-11-28T17:19:48+00:00</updated>
<entry>
<title>samples/bpf: syscall_tp_user: Fix array out-of-bound access</title>
<updated>2023-11-28T17:19:48+00:00</updated>
<author>
<name>Jinghao Jia</name>
<email>jinghao@linux.ibm.com</email>
</author>
<published>2023-09-17T21:42:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=de4825a444560f8cb78b03dda3ba873fab88bc4f'/>
<id>urn:sha1:de4825a444560f8cb78b03dda3ba873fab88bc4f</id>
<content type='text'>
[ Upstream commit 9220c3ef6fefbf18f24aeedb1142a642b3de0596 ]

Commit 06744f24696e ("samples/bpf: Add openat2() enter/exit tracepoint
to syscall_tp sample") added two more eBPF programs to support the
openat2() syscall. However, it did not increase the size of the array
that holds the corresponding bpf_links. This leads to an out-of-bound
access on that array in the bpf_object__for_each_program loop and could
corrupt other variables on the stack. On our testing QEMU, it corrupts
the map1_fds array and causes the sample to fail:

  # ./syscall_tp
  prog #0: map ids 4 5
  verify map:4 val: 5
  map_lookup failed: Bad file descriptor

Dynamically allocate the array based on the number of programs reported
by libbpf to prevent similar inconsistencies in the future

Fixes: 06744f24696e ("samples/bpf: Add openat2() enter/exit tracepoint to syscall_tp sample")
Signed-off-by: Jinghao Jia &lt;jinghao@linux.ibm.com&gt;
Signed-off-by: Ruowen Qin &lt;ruowenq2@illinois.edu&gt;
Signed-off-by: Jinghao Jia &lt;jinghao7@illinois.edu&gt;
Link: https://lore.kernel.org/r/20230917214220.637721-4-jinghao7@illinois.edu
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/bpf: syscall_tp_user: Rename num_progs into nr_tests</title>
<updated>2023-11-28T17:19:48+00:00</updated>
<author>
<name>Jinghao Jia</name>
<email>jinghao@linux.ibm.com</email>
</author>
<published>2023-09-17T21:42:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=948189f679ac9820c57c7801d592442b7d122972'/>
<id>urn:sha1:948189f679ac9820c57c7801d592442b7d122972</id>
<content type='text'>
[ Upstream commit 0ee352fe0d28015cab161b04d202fa3231c0ba3b ]

The variable name num_progs causes confusion because that variable
really controls the number of rounds the test should be executed.

Rename num_progs into nr_tests for the sake of clarity.

Signed-off-by: Jinghao Jia &lt;jinghao@linux.ibm.com&gt;
Signed-off-by: Ruowen Qin &lt;ruowenq2@illinois.edu&gt;
Signed-off-by: Jinghao Jia &lt;jinghao7@illinois.edu&gt;
Link: https://lore.kernel.org/r/20230917214220.637721-3-jinghao7@illinois.edu
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Stable-dep-of: 9220c3ef6fef ("samples/bpf: syscall_tp_user: Fix array out-of-bound access")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>samples/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK</title>
<updated>2022-04-11T03:17:15+00:00</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2022-04-09T12:59:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b25acdafd3730110254f8452b113a6311ab5cf2d'/>
<id>urn:sha1:b25acdafd3730110254f8452b113a6311ab5cf2d</id>
<content type='text'>
We have switched to memcg-based memory accouting and thus the rlimit is
not needed any more. LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK was introduced in
libbpf for backward compatibility, so we can use it instead now.

This patch also removes the useless header sys/resource.h from many files
in samples/bpf.

Signed-off-by: Yafang Shao &lt;laoar.shao@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20220409125958.92629-2-laoar.shao@gmail.com
</content>
</entry>
<entry>
<title>sample: bpf: syscall_tp_user: Print result of verify_map</title>
<updated>2022-04-04T21:43:57+00:00</updated>
<author>
<name>Song Chen</name>
<email>chensong_2000@189.cn</email>
</author>
<published>2022-04-02T08:57:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=35f91d1fe106cd474ac0463157d012c675385e18'/>
<id>urn:sha1:35f91d1fe106cd474ac0463157d012c675385e18</id>
<content type='text'>
At the end of the test, we already print out
    prog &lt;prog number&gt;: map ids &lt;...&gt; &lt;...&gt;
Value is the number read from kernel through bpf map, further print out
    verify map:&lt;map id&gt; val:&lt;...&gt;
will help users to understand the program runs successfully.

Signed-off-by: Song Chen &lt;chensong_2000@189.cn&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/1648889828-12417-1-git-send-email-chensong_2000@189.cn
</content>
</entry>
<entry>
<title>bpf: samples: Do not touch RLIMIT_MEMLOCK</title>
<updated>2020-12-03T02:32:47+00:00</updated>
<author>
<name>Roman Gushchin</name>
<email>guro@fb.com</email>
</author>
<published>2020-12-01T21:59:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5b0764b2d34510bc87d33a580da98f77789ac36f'/>
<id>urn:sha1:5b0764b2d34510bc87d33a580da98f77789ac36f</id>
<content type='text'>
Since bpf is not using rlimit memlock for the memory accounting
and control, do not change the limit in sample applications.

Signed-off-by: Roman Gushchin &lt;guro@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20201201215900.3569844-35-guro@fb.com
</content>
</entry>
<entry>
<title>samples: bpf: Refactor tracepoint tracing programs with libbpf</title>
<updated>2020-08-25T03:59:35+00:00</updated>
<author>
<name>Daniel T. Lee</name>
<email>danieltimlee@gmail.com</email>
</author>
<published>2020-08-23T08:53:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f0c328f8af5d920a68f8217aec76d9a45288cef1'/>
<id>urn:sha1:f0c328f8af5d920a68f8217aec76d9a45288cef1</id>
<content type='text'>
For the problem of increasing fragmentation of the bpf loader programs,
instead of using bpf_loader.o, which is used in samples/bpf, this
commit refactors the existing tracepoint tracing programs with libbbpf
bpf loader.

    - Adding a tracepoint event and attaching a bpf program to it was done
    through bpf_program_attach().
    - Instead of using the existing BPF MAP definition, MAP definition
    has been refactored with the new BTF-defined MAP format.

Signed-off-by: Daniel T. Lee &lt;danieltimlee@gmail.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200823085334.9413-4-danieltimlee@gmail.com
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 206</title>
<updated>2019-05-30T18:29:53+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-28T17:10:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=25763b3c864cf517d686661012d184ee47a49b4c'/>
<id>urn:sha1:25763b3c864cf517d686661012d184ee47a49b4c</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of version 2 of the gnu general public license as
  published by the free software foundation

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 107 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Richard Fontana &lt;rfontana@redhat.com&gt;
Reviewed-by: Steve Winslow &lt;swinslow@gmail.com&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528171438.615055994@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>samples: bpf: include bpf/bpf.h instead of local libbpf.h</title>
<updated>2018-05-15T05:52:10+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>jakub.kicinski@netronome.com</email>
</author>
<published>2018-05-15T05:35:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2bf3e2ef425bc2a164f10b554b7db6a8b4090ef4'/>
<id>urn:sha1:2bf3e2ef425bc2a164f10b554b7db6a8b4090ef4</id>
<content type='text'>
There are two files in the tree called libbpf.h which is becoming
problematic.  Most samples don't actually need the local libbpf.h
they simply include it to get to bpf/bpf.h.  Include bpf/bpf.h
directly instead.

Signed-off-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
Acked-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpf: add a test case to test single tp multiple bpf attachment</title>
<updated>2017-10-25T01:47:47+00:00</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2017-10-24T06:53:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a678be5cc747bafc8c66f2fe00a103422587a5eb'/>
<id>urn:sha1:a678be5cc747bafc8c66f2fe00a103422587a5eb</id>
<content type='text'>
The bpf sample program syscall_tp is modified to
show attachment of more than bpf programs
for a particular kernel tracepoint.

Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bpf: add a test case for syscalls/sys_{enter|exit}_* tracepoints</title>
<updated>2017-08-07T21:09:48+00:00</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2017-08-04T23:00:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1da236b6be9632255ab034f22aca5b78d7c3c007'/>
<id>urn:sha1:1da236b6be9632255ab034f22aca5b78d7c3c007</id>
<content type='text'>
Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
