<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/bpf/prog_tests, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-05-14T08:53:04Z</updated>
<entry>
<title>selftests/bpf: Fix core_reloc test runner</title>
<updated>2021-05-14T08:53:04Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-04-26T19:29:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e738b042761ae9c08b7f9a2138917eba86461b15'/>
<id>urn:sha1:e738b042761ae9c08b7f9a2138917eba86461b15</id>
<content type='text'>
[ Upstream commit bede0ebf0be87e9678103486a77f39e0334c6791 ]

Fix failed tests checks in core_reloc test runner, which allowed failing tests
to pass quietly. Also add extra check to make sure that expected to fail test cases with
invalid names are caught as test failure anyway, as this is not an expected
failure mode. Also fix mislabeled probed vs direct bitfield test cases.

Fixes: 124a892d1c41 ("selftests/bpf: Test TYPE_EXISTS and TYPE_SIZE CO-RE relocations")
Reported-by: Lorenz Bauer &lt;lmb@cloudflare.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Lorenz Bauer &lt;lmb@cloudflare.com&gt;
Link: https://lore.kernel.org/bpf/20210426192949.416837-6-andrii@kernel.org
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Fix field existence CO-RE reloc tests</title>
<updated>2021-05-14T08:53:04Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-04-26T19:29:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dade94cf32233b13e3e672fc10e2a4dc0eb871b5'/>
<id>urn:sha1:dade94cf32233b13e3e672fc10e2a4dc0eb871b5</id>
<content type='text'>
[ Upstream commit 5a30eb23922b52f33222c6729b6b3ff1c37a6c66 ]

Negative field existence cases for have a broken assumption that FIELD_EXISTS
CO-RE relo will fail for fields that match the name but have incompatible type
signature. That's not how CO-RE relocations generally behave. Types and fields
that match by name but not by expected type are treated as non-matching
candidates and are skipped. Error later is reported if no matching candidate
was found. That's what happens for most relocations, but existence relocations
(FIELD_EXISTS and TYPE_EXISTS) are more permissive and they are designed to
return 0 or 1, depending if a match is found. This allows to handle
name-conflicting but incompatible types in BPF code easily. Combined with
___flavor suffixes, it's possible to handle pretty much any structural type
changes in kernel within the compiled once BPF source code.

So, long story short, negative field existence test cases are invalid in their
assumptions, so this patch reworks them into a single consolidated positive
case that doesn't match any of the fields.

Fixes: c7566a69695c ("selftests/bpf: Add field existence CO-RE relocs tests")
Reported-by: Lorenz Bauer &lt;lmb@cloudflare.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Lorenz Bauer &lt;lmb@cloudflare.com&gt;
Link: https://lore.kernel.org/bpf/20210426192949.416837-5-andrii@kernel.org
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpf/selftests: Test that kernel rejects a TCP CC with an invalid license</title>
<updated>2021-03-26T16:51:02Z</updated>
<author>
<name>Toke Høiland-Jørgensen</name>
</author>
<published>2021-03-26T10:03:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d8e8052e42d0f8ff59898b9b4142b16958627ac9'/>
<id>urn:sha1:d8e8052e42d0f8ff59898b9b4142b16958627ac9</id>
<content type='text'>
This adds a selftest to check that the verifier rejects a TCP CC struct_ops
with a non-GPL license.

Signed-off-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Link: https://lore.kernel.org/bpf/20210326100314.121853-2-toke@redhat.com
</content>
</entry>
<entry>
<title>selftest/bpf: Add a test to check trampoline freeing logic.</title>
<updated>2021-03-18T16:13:42Z</updated>
<author>
<name>Alexei Starovoitov</name>
</author>
<published>2021-03-18T00:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eddbe8e6521401003e37e7848ef72e75c10ee2aa'/>
<id>urn:sha1:eddbe8e6521401003e37e7848ef72e75c10ee2aa</id>
<content type='text'>
Add a selftest for commit e21aa341785c ("bpf: Fix fexit trampoline.")
to make sure that attaching fexit prog to a sleeping kernel function
will trigger appropriate trampoline and program destruction.

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20210318004523.55908-1-alexei.starovoitov@gmail.com
</content>
</entry>
<entry>
<title>selftests/bpf: Tests using bpf_check_mtu BPF-helper input mtu_len param</title>
<updated>2021-03-08T21:45:56Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
</author>
<published>2021-03-08T14:59:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e5e010a3063ad801cb3f85793cbada9c2a654e40'/>
<id>urn:sha1:e5e010a3063ad801cb3f85793cbada9c2a654e40</id>
<content type='text'>
Add tests that use mtu_len as input parameter in BPF-helper
bpf_check_mtu().

The BPF-helper is avail from both XDP and TC context. Add two tests
per context, one that tests below MTU and one that exceeds the MTU.

Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Link: https://lore.kernel.org/bpf/161521556358.3515614.5915221479709358964.stgit@firesoul
</content>
</entry>
<entry>
<title>selftests/bpf: Add unit tests for pointers in global functions</title>
<updated>2021-02-13T01:37:23Z</updated>
<author>
<name>Dmitrii Banshchikov</name>
</author>
<published>2021-02-12T20:56:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b08807d039a843163fd4aeca93aec69dfc4fbcf'/>
<id>urn:sha1:8b08807d039a843163fd4aeca93aec69dfc4fbcf</id>
<content type='text'>
test_global_func9  - check valid pointer's scenarios
test_global_func10 - check that a smaller type cannot be passed as a
                     larger one
test_global_func11 - check that CTX pointer cannot be passed
test_global_func12 - check access to a null pointer
test_global_func13 - check access to an arbitrary pointer value
test_global_func14 - check that an opaque pointer cannot be passed
test_global_func15 - check that a variable has an unknown value after
		     it was passed to a global function by pointer
test_global_func16 - check access to uninitialized stack memory

test_global_func_args - check read and write operations through a pointer

Signed-off-by: Dmitrii Banshchikov &lt;me@ubique.spb.ru&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210212205642.620788-5-me@ubique.spb.ru
</content>
</entry>
<entry>
<title>selftests/bpf: Tests using bpf_check_mtu BPF-helper</title>
<updated>2021-02-13T00:15:28Z</updated>
<author>
<name>Jesper Dangaard Brouer</name>
</author>
<published>2021-02-09T13:38:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b62eba563229fc7c51af41b55fc67c4778d85bb7'/>
<id>urn:sha1:b62eba563229fc7c51af41b55fc67c4778d85bb7</id>
<content type='text'>
Adding selftest for BPF-helper bpf_check_mtu(). Making sure
it can be used from both XDP and TC.

V16:
 - Fix 'void' function definition

V11:
 - Addresse nitpicks from Andrii Nakryiko

V10:
 - Remove errno non-zero test in CHECK_ATTR()
 - Addresse comments from Andrii Nakryiko

Signed-off-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/161287791989.790810.13612620012522164562.stgit@firesoul
</content>
</entry>
<entry>
<title>selftests/bpf: Add test for bpf_iter_task_vma</title>
<updated>2021-02-12T20:56:54Z</updated>
<author>
<name>Song Liu</name>
</author>
<published>2021-02-12T18:31:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8168840e16c606b3de38148c97262638b41750d'/>
<id>urn:sha1:e8168840e16c606b3de38148c97262638b41750d</id>
<content type='text'>
The test dumps information similar to /proc/pid/maps. The first line of
the output is compared against the /proc file to make sure they match.

Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Link: https://lore.kernel.org/bpf/20210212183107.50963-4-songliubraving@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add a selftest for the tracing bpf_get_socket_cookie</title>
<updated>2021-02-12T01:44:41Z</updated>
<author>
<name>Florent Revest</name>
</author>
<published>2021-02-10T11:14:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6fdd671baaf587cca17603485f9ef4bf7a1f9be1'/>
<id>urn:sha1:6fdd671baaf587cca17603485f9ef4bf7a1f9be1</id>
<content type='text'>
This builds up on the existing socket cookie test which checks whether
the bpf_get_socket_cookie helpers provide the same value in
cgroup/connect6 and sockops programs for a socket created by the
userspace part of the test.

Instead of having an update_cookie sockops program tag a socket local
storage with 0xFF, this uses both an update_cookie_sockops program and
an update_cookie_tracing program which succesively tag the socket with
0x0F and then 0xF0.

Signed-off-by: Florent Revest &lt;revest@chromium.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: KP Singh &lt;kpsingh@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210210111406.785541-5-revest@chromium.org
</content>
</entry>
<entry>
<title>selftests/bpf: Integrate the socket_cookie test to test_progs</title>
<updated>2021-02-12T01:44:41Z</updated>
<author>
<name>Florent Revest</name>
</author>
<published>2021-02-10T11:14:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61f8c9c8f3c8fb60722f0f3168d1a546dbf8a3d4'/>
<id>urn:sha1:61f8c9c8f3c8fb60722f0f3168d1a546dbf8a3d4</id>
<content type='text'>
Currently, the selftest for the BPF socket_cookie helpers is built and
run independently from test_progs. It's easy to forget and hard to
maintain.

This patch moves the socket cookies test into prog_tests/ and vastly
simplifies its logic by:
- rewriting the loading code with BPF skeletons
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs

Signed-off-by: Florent Revest &lt;revest@chromium.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: KP Singh &lt;kpsingh@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210210111406.785541-3-revest@chromium.org
</content>
</entry>
</feed>
