<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/bpf/config, branch linux-5.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-12-17T22:11:13Z</updated>
<entry>
<title>selftests/bpf: Add libbpf feature-probing API selftests</title>
<updated>2021-12-17T22:11:13Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-12-17T17:12:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a8ea82f9d25e88e502d1c3a1a9ba639f69a63c0'/>
<id>urn:sha1:5a8ea82f9d25e88e502d1c3a1a9ba639f69a63c0</id>
<content type='text'>
Add selftests for prog/map/prog+helper feature probing APIs. Prog and
map selftests are designed in such a way that they will always test all
the possible prog/map types, based on running kernel's vmlinux BTF enum
definition. This way we'll always be sure that when adding new BPF
program types or map types, libbpf will be always updated accordingly to
be able to feature-detect them.

BPF prog_helper selftest will have to be manually extended with
interesting and important prog+helper combinations, it's easy, but can't
be completely automated.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Dave Marchevsky &lt;davemarchevsky@fb.com&gt;
Link: https://lore.kernel.org/bpf/20211217171202.3352835-3-andrii@kernel.org
</content>
</entry>
<entry>
<title>bpf: selftests: Specify CONFIG_DYNAMIC_FTRACE in the testing config</title>
<updated>2021-04-03T16:09:50Z</updated>
<author>
<name>Martin KaFai Lau</name>
</author>
<published>2021-04-03T00:29:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f73ea1eb4cce66376cc1dd94b4a083ffb9eeb123'/>
<id>urn:sha1:f73ea1eb4cce66376cc1dd94b4a083ffb9eeb123</id>
<content type='text'>
The tracing test and the recent kfunc call test require
CONFIG_DYNAMIC_FTRACE.  This patch adds it to the config file.

Signed-off-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210403002921.3419721-1-kafai@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add config dependency on BLK_DEV_LOOP</title>
<updated>2020-12-03T19:20:21Z</updated>
<author>
<name>KP Singh</name>
</author>
<published>2020-12-03T19:14:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d932e043b9d6d60113e90267ae2fbe4e946d7b08'/>
<id>urn:sha1:d932e043b9d6d60113e90267ae2fbe4e946d7b08</id>
<content type='text'>
The ima selftest restricts its scope to a test filesystem image
mounted on a loop device and prevents permanent ima policy changes for
the whole system.

Fixes: 34b82d3ac105 ("bpf: Add a selftest for bpf_ima_inode_hash")
Reported-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: KP Singh &lt;kpsingh@google.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20201203191437.666737-4-kpsingh@chromium.org
</content>
</entry>
<entry>
<title>bpf: Add a selftest for bpf_ima_inode_hash</title>
<updated>2020-11-25T23:25:47Z</updated>
<author>
<name>KP Singh</name>
</author>
<published>2020-11-24T15:12:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=34b82d3ac1058653b3de7be4697b55f67533b1f1'/>
<id>urn:sha1:34b82d3ac1058653b3de7be4697b55f67533b1f1</id>
<content type='text'>
The test does the following:

- Mounts a loopback filesystem and appends the IMA policy to measure
  executions only on this file-system. Restricting the IMA policy to
  a particular filesystem prevents a system-wide IMA policy change.
- Executes an executable copied to this loopback filesystem.
- Calls the bpf_ima_inode_hash in the bprm_committed_creds hook and
  checks if the call succeeded and checks if a hash was calculated.

The test shells out to the added ima_setup.sh script as the setup is
better handled in a shell script and is more complicated to do in the
test program or even shelling out individual commands from C.

The list of required configs (i.e. IMA, SECURITYFS,
IMA_{WRITE,READ}_POLICY) for running this test are also updated.

Suggested-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt; (limit policy rule to loopback mount)
Signed-off-by: KP Singh &lt;kpsingh@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Link: https://lore.kernel.org/bpf/20201124151210.1081188-4-kpsingh@chromium.org
</content>
</entry>
<entry>
<title>selftests/bpf: CONFIG_LIRC required for test_lirc_mode2.sh</title>
<updated>2020-05-22T23:12:31Z</updated>
<author>
<name>Alan Maguire</name>
</author>
<published>2020-05-22T11:36:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5dfaa2ab94057dd75c7911143482a0a85593c14'/>
<id>urn:sha1:a5dfaa2ab94057dd75c7911143482a0a85593c14</id>
<content type='text'>
test_lirc_mode2.sh assumes presence of /sys/class/rc/rc0/lirc*/uevent
which will not be present unless CONFIG_LIRC=y

Fixes: 6bdd533cee9a ("bpf: add selftest for lirc_mode2 type program")
Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/1590147389-26482-3-git-send-email-alan.maguire@oracle.com
</content>
</entry>
<entry>
<title>selftests/bpf: CONFIG_IPV6_SEG6_BPF required for test_seg6_loop.o</title>
<updated>2020-05-22T23:12:31Z</updated>
<author>
<name>Alan Maguire</name>
</author>
<published>2020-05-22T11:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c8e8cf4b18b3a7034fab4c4504fc4b54e4b6195'/>
<id>urn:sha1:3c8e8cf4b18b3a7034fab4c4504fc4b54e4b6195</id>
<content type='text'>
test_seg6_loop.o uses the helper bpf_lwt_seg6_adjust_srh();
it will not be present if CONFIG_IPV6_SEG6_BPF is not specified.

Fixes: b061017f8b4d ("selftests/bpf: add realistic loop tests")
Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/1590147389-26482-2-git-send-email-alan.maguire@oracle.com
</content>
</entry>
<entry>
<title>bpf: lsm: Add selftests for BPF_PROG_TYPE_LSM</title>
<updated>2020-03-29T23:35:11Z</updated>
<author>
<name>KP Singh</name>
</author>
<published>2020-03-29T00:43:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03e54f100d5756f8403fffd60aed8e883ea864c0'/>
<id>urn:sha1:03e54f100d5756f8403fffd60aed8e883ea864c0</id>
<content type='text'>
* Load/attach a BPF program that hooks to file_mprotect (int)
  and bprm_committed_creds (void).
* Perform an action that triggers the hook.
* Verify if the audit event was received using the shared global
  variables for the process executed.
* Verify if the mprotect returns a -EPERM.

Signed-off-by: KP Singh &lt;kpsingh@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Reviewed-by: Brendan Jackman &lt;jackmanb@google.com&gt;
Reviewed-by: Florent Revest &lt;revest@google.com&gt;
Reviewed-by: Thomas Garnier &lt;thgarnie@google.com&gt;
Reviewed-by: James Morris &lt;jamorris@linux.microsoft.com&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200329004356.27286-8-kpsingh@chromium.org
</content>
</entry>
<entry>
<title>selftests/bpf: add config fragment BPF_JIT</title>
<updated>2019-08-21T15:05:06Z</updated>
<author>
<name>Anders Roxell</name>
</author>
<published>2019-08-20T13:41:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0604409df9e04cdec7b08d471c8c1c0c10b5554d'/>
<id>urn:sha1:0604409df9e04cdec7b08d471c8c1c0c10b5554d</id>
<content type='text'>
When running test_kmod.sh the following shows up

 # sysctl cannot stat /proc/sys/net/core/bpf_jit_enable No such file or directory
 cannot: stat_/proc/sys/net/core/bpf_jit_enable #
 # sysctl cannot stat /proc/sys/net/core/bpf_jit_harden No such file or directory
 cannot: stat_/proc/sys/net/core/bpf_jit_harden #

Rework to enable CONFIG_BPF_JIT to solve "No such file or directory"

Signed-off-by: Anders Roxell &lt;anders.roxell@linaro.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: expand test_tc_tunnel with SIT encap</title>
<updated>2019-04-23T23:32:26Z</updated>
<author>
<name>Willem de Bruijn</name>
</author>
<published>2019-04-23T18:43:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f6ad6accaa99dfa7462d18687961b8421d707c1e'/>
<id>urn:sha1:f6ad6accaa99dfa7462d18687961b8421d707c1e</id>
<content type='text'>
So far, all BPF tc tunnel testcases encapsulate in the same network
protocol. Add an encap testcase that requires updating skb-&gt;protocol.

The 6in4 tunnel encapsulates an IPv6 packet inside an IPv4 tunnel.
Verify that bpf_skb_net_grow correctly updates skb-&gt;protocol to
select the right protocol handler in __netif_receive_skb_core.

The BPF program should also manually update the link layer header to
encode the right network protocol.

Changes v1-&gt;v2
  - improve documentation of non-obvious logic

Signed-off-by: Willem de Bruijn &lt;willemb@google.com&gt;
Tested-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>selftests_bpf: add L2 encap to test_tc_tunnel</title>
<updated>2019-04-11T20:50:57Z</updated>
<author>
<name>Alan Maguire</name>
</author>
<published>2019-04-09T14:06:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ec61df82ba0c2d2455da838ee46bf60f2256b56'/>
<id>urn:sha1:3ec61df82ba0c2d2455da838ee46bf60f2256b56</id>
<content type='text'>
Update test_tc_tunnel to verify adding inner L2 header
encapsulation (an MPLS label or ethernet header) works.

Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
</feed>
