diff options
| author | Ihor Solodrai <[email protected]> | 2025-07-02 21:03:09 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2025-07-03 22:21:20 +0000 |
| commit | 7b29689263fb21cd0394a664d7d2d1cbc9d1fff1 (patch) | |
| tree | c3261a2c80bc9cf17bec5e3d0b23c4284e3a4635 /tools/testing/selftests/bpf/prog_tests/dynptr.c | |
| parent | bpf: Add bpf_dynptr_memset() kfunc (diff) | |
| download | kernel-7b29689263fb21cd0394a664d7d2d1cbc9d1fff1.tar.gz kernel-7b29689263fb21cd0394a664d7d2d1cbc9d1fff1.zip | |
selftests/bpf: Add test cases for bpf_dynptr_memset()
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 <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Mykyta Yatsenko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/dynptr.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/dynptr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/dynptr.c b/tools/testing/selftests/bpf/prog_tests/dynptr.c index 62e7ec775f24..f2b65398afce 100644 --- a/tools/testing/selftests/bpf/prog_tests/dynptr.c +++ b/tools/testing/selftests/bpf/prog_tests/dynptr.c @@ -21,6 +21,14 @@ static struct { {"test_dynptr_data", SETUP_SYSCALL_SLEEP}, {"test_dynptr_copy", SETUP_SYSCALL_SLEEP}, {"test_dynptr_copy_xdp", SETUP_XDP_PROG}, + {"test_dynptr_memset_zero", SETUP_SYSCALL_SLEEP}, + {"test_dynptr_memset_notzero", SETUP_SYSCALL_SLEEP}, + {"test_dynptr_memset_zero_offset", SETUP_SYSCALL_SLEEP}, + {"test_dynptr_memset_zero_adjusted", SETUP_SYSCALL_SLEEP}, + {"test_dynptr_memset_overflow", SETUP_SYSCALL_SLEEP}, + {"test_dynptr_memset_overflow_offset", SETUP_SYSCALL_SLEEP}, + {"test_dynptr_memset_readonly", SETUP_SKB_PROG}, + {"test_dynptr_memset_xdp_chunks", SETUP_XDP_PROG}, {"test_ringbuf", SETUP_SYSCALL_SLEEP}, {"test_skb_readonly", SETUP_SKB_PROG}, {"test_dynptr_skb_data", SETUP_SKB_PROG}, |
