<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/bpf/prog_tests/dynptr.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-02-24T16:19:49Z</updated>
<entry>
<title>selftests/bpf: Fix resource leaks caused by missing cleanups</title>
<updated>2026-02-24T16:19:49Z</updated>
<author>
<name>Ihor Solodrai</name>
</author>
<published>2026-02-23T19:07:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=71dca2950fe9abf8e6fd3d9f5e6342da6634b898'/>
<id>urn:sha1:71dca2950fe9abf8e6fd3d9f5e6342da6634b898</id>
<content type='text'>
ASAN reported a number of resource leaks:
  - Add missing  *__destroy(skel) calls
  - Replace bpf_link__detach() with bpf_link__destroy() where appropriate
  - cgrp_local_storage: Add bpf_link__destroy() when bpf_iter_create fails
  - dynptr: Add missing bpf_object__close()

Acked-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Signed-off-by: Ihor Solodrai &lt;ihor.solodrai@linux.dev&gt;
Link: https://lore.kernel.org/r/20260223190736.649171-16-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;

</content>
</entry>
<entry>
<title>selftests/bpf: Cover verifier checks for skb_meta dynptr type</title>
<updated>2025-08-18T17:29:42Z</updated>
<author>
<name>Jakub Sitnicki</name>
</author>
<published>2025-08-14T09:59:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e74eb4d57f00e6103ac23ce2312766c25ad88f6'/>
<id>urn:sha1:0e74eb4d57f00e6103ac23ce2312766c25ad88f6</id>
<content type='text'>
dynptr for skb metadata behaves the same way as the dynptr for skb data
with one exception - writes to skb_meta dynptr don't invalidate existing
skb and skb_meta slices.

Duplicate those the skb dynptr tests which we can, since
bpf_dynptr_from_skb_meta kfunc can be called only from TC BPF, to cover the
skb_meta dynptr verifier checks.

Also add a couple of new tests (skb_data_valid_*) to ensure we don't
invalidate the slices in the mentioned case, which are specific to skb_meta
dynptr.

Signed-off-by: Jakub Sitnicki &lt;jakub@cloudflare.com&gt;
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
Reviewed-by: Jesse Brandeburg &lt;jbrandeburg@cloudflare.com&gt;
Link: https://patch.msgid.link/20250814-skb-metadata-thru-dynptr-v7-3-8a39e636e0fb@cloudflare.com
</content>
</entry>
<entry>
<title>selftests/bpf: Increase xdp data size for arm64 64K page size</title>
<updated>2025-07-26T01:20:43Z</updated>
<author>
<name>Yonghong Song</name>
</author>
<published>2025-07-25T04:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4c82768e413402c329043ed2a30a36bdfc82127b'/>
<id>urn:sha1:4c82768e413402c329043ed2a30a36bdfc82127b</id>
<content type='text'>
With arm64 64K page size, the following 4 subtests failed:
  #97/25   dynptr/test_probe_read_user_dynptr:FAIL
  #97/26   dynptr/test_probe_read_kernel_dynptr:FAIL
  #97/27   dynptr/test_probe_read_user_str_dynptr:FAIL
  #97/28   dynptr/test_probe_read_kernel_str_dynptr:FAIL

These failures are due to function bpf_dynptr_check_off_len() in
include/linux/bpf.h where there is a test
  if (len &gt; size || offset &gt; size - len)
    return -E2BIG;
With 64K page size, the 'offset' is greater than 'size - len',
which caused the test failure.

For 64KB page size, this patch increased the xdp buffer size from 5000 to
90000. The above 4 test failures are fixed as 'size' value is increased.
But it introduced two new failures:
  #97/4    dynptr/test_dynptr_copy_xdp:FAIL
  #97/12   dynptr/test_dynptr_memset_xdp_chunks:FAIL

These two failures will be addressed in subsequent patches.

Signed-off-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
Acked-by: Mykyta Yatsenko &lt;yatsenko@meta.com&gt;
Link: https://patch.msgid.link/20250725043430.208469-1-yonghong.song@linux.dev
</content>
</entry>
<entry>
<title>selftests/bpf: Add test cases for bpf_dynptr_memset()</title>
<updated>2025-07-03T22:21:20Z</updated>
<author>
<name>Ihor Solodrai</name>
</author>
<published>2025-07-02T21:03:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7b29689263fb21cd0394a664d7d2d1cbc9d1fff1'/>
<id>urn:sha1:7b29689263fb21cd0394a664d7d2d1cbc9d1fff1</id>
<content type='text'>
Add tests to verify the behavior of bpf_dynptr_memset():
  * normal memset 0
  * normal memset non-0
  * memset with an offset
  * memset in dynptr that was adjusted
  * error: size overflow
  * error: offset+size overflow
  * error: readonly dynptr
  * memset into non-linear xdp dynptr

Signed-off-by: Ihor Solodrai &lt;isolodrai@meta.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Mykyta Yatsenko &lt;yatsenko@meta.com&gt;
Link: https://lore.kernel.org/bpf/20250702210309.3115903-3-isolodrai@meta.com
</content>
</entry>
<entry>
<title>selftests/bpf: introduce tests for dynptr copy kfuncs</title>
<updated>2025-05-13T01:32:47Z</updated>
<author>
<name>Mykyta Yatsenko</name>
</author>
<published>2025-05-12T20:53:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c61bcd29eda9ea8db753ad5217fd24d9ee42a96b'/>
<id>urn:sha1:c61bcd29eda9ea8db753ad5217fd24d9ee42a96b</id>
<content type='text'>
Introduce selftests verifying newly-added dynptr copy kfuncs.
Covering contiguous and non-contiguous memory backed dynptrs.

Disable test_probe_read_user_str_dynptr that triggers bug in
strncpy_from_user_nofault. Patch to fix the issue [1].

[1] https://patchwork.kernel.org/project/linux-mm/patch/20250422131449.57177-1-mykyta.yatsenko5@gmail.com/

Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Mykyta Yatsenko &lt;yatsenko@meta.com&gt;
Link: https://lore.kernel.org/r/20250512205348.191079-4-mykyta.yatsenko5@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for bpf_dynptr_copy</title>
<updated>2025-03-15T18:48:20Z</updated>
<author>
<name>Mykyta Yatsenko</name>
</author>
<published>2025-02-26T18:32:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=064e9aacfd70a7805eeb0fc9ec6e97247ea8bc4c'/>
<id>urn:sha1:064e9aacfd70a7805eeb0fc9ec6e97247ea8bc4c</id>
<content type='text'>
Add XDP setup type for dynptr tests, enabling testing for
non-contiguous buffer.
Add 2 tests:
 - test_dynptr_copy - verify correctness for the fast (contiguous
 buffer) code path.
 - test_dynptr_copy_xdp - verifies code paths that handle
 non-contiguous buffer.

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/20250226183201.332713-4-mykyta.yatsenko5@gmail.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Expand skb dynptr selftests for tp_btf</title>
<updated>2024-09-11T15:57:54Z</updated>
<author>
<name>Philo Lu</name>
</author>
<published>2024-09-11T03:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83dff601715bdc086dc1fc470ee3aaff42215e65'/>
<id>urn:sha1:83dff601715bdc086dc1fc470ee3aaff42215e65</id>
<content type='text'>
Add 3 test cases for skb dynptr used in tp_btf:
- test_dynptr_skb_tp_btf: use skb dynptr in tp_btf and make sure it is
  read-only.
- skb_invalid_ctx_fentry/skb_invalid_ctx_fexit: bpf_dynptr_from_skb
  should fail in fentry/fexit.

In test_dynptr_skb_tp_btf, to trigger the tracepoint in kfree_skb,
test_pkt_access is used for its test_run, as in kfree_skb.c. Because the
test process is different from others, a new setup type is defined,
i.e., SETUP_SKB_PROG_TP.

The result is like:
$ ./test_progs -t 'dynptr/test_dynptr_skb_tp_btf'
  #84/14   dynptr/test_dynptr_skb_tp_btf:OK
  #84      dynptr:OK
  #127     kfunc_dynptr_param:OK
  Summary: 2/1 PASSED, 0 SKIPPED, 0 FAILED

$ ./test_progs -t 'dynptr/skb_invalid_ctx_f'
  #84/85   dynptr/skb_invalid_ctx_fentry:OK
  #84/86   dynptr/skb_invalid_ctx_fexit:OK
  #84      dynptr:OK
  #127     kfunc_dynptr_param:OK
  Summary: 2/2 PASSED, 0 SKIPPED, 0 FAILED

Also fix two coding style nits (change spaces to tabs).

Signed-off-by: Philo Lu &lt;lulie@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20240911033719.91468-6-lulie@linux.alibaba.com
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Accept mem from dynptr in helper funcs</title>
<updated>2023-05-06T23:42:58Z</updated>
<author>
<name>Daniel Rosenberg</name>
</author>
<published>2023-05-06T01:31:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=798e48fc28fa64aa4eca6e8a404fa20ac8f7c09e'/>
<id>urn:sha1:798e48fc28fa64aa4eca6e8a404fa20ac8f7c09e</id>
<content type='text'>
This ensures that buffers retrieved from dynptr_data are allowed to be
passed in to helpers that take mem, like bpf_strncmp

Signed-off-by: Daniel Rosenberg &lt;drosen@google.com&gt;
Link: https://lore.kernel.org/r/20230506013134.2492210-6-drosen@google.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Test allowing NULL buffer in dynptr slice</title>
<updated>2023-05-06T23:42:57Z</updated>
<author>
<name>Daniel Rosenberg</name>
</author>
<published>2023-05-06T01:31:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1ce33b6c846fbe0439eeee477b767de4bc3ad35f'/>
<id>urn:sha1:1ce33b6c846fbe0439eeee477b767de4bc3ad35f</id>
<content type='text'>
bpf_dynptr_slice(_rw) no longer requires a buffer for verification. If the
buffer is needed, but not present, the function will return NULL.

Signed-off-by: Daniel Rosenberg &lt;drosen@google.com&gt;
Link: https://lore.kernel.org/r/20230506013134.2492210-3-drosen@google.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for dynptr convenience helpers</title>
<updated>2023-04-27T08:40:52Z</updated>
<author>
<name>Joanne Koong</name>
</author>
<published>2023-04-20T07:14:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d911ba7ceafd29606df4018bbd87a1642f9e6d88'/>
<id>urn:sha1:d911ba7ceafd29606df4018bbd87a1642f9e6d88</id>
<content type='text'>
Add various tests for the added dynptr convenience helpers.

Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20230420071414.570108-6-joannelkoong@gmail.com
</content>
</entry>
</feed>
