]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Add tests for FIONREAD and copied_seq
authorJiayuan Chen <jiayuan.chen@linux.dev>
Sat, 24 Jan 2026 11:32:45 +0000 (19:32 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 27 Jan 2026 17:12:04 +0000 (09:12 -0800)
commit17e2ce02bf5669dfa659976e93d409228cba98f9
tree597b4c1d7bf7711314914dd0311c06e13a645345
parent929e30f9312514902133c45e51c79088421ab084
selftests/bpf: Add tests for FIONREAD and copied_seq

This commit adds two new test functions: one to reproduce the bug reported
by syzkaller [1], and another to cover the calculation of copied_seq.

The tests primarily involve installing  and uninstalling sockmap on
sockets, then reading data to verify proper functionality.

Additionally, extend the do_test_sockmap_skb_verdict_fionread() function
to support UDP FIONREAD testing.

[1] https://syzkaller.appspot.com/bug?extid=06dbd397158ec0ea4983

Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/r/20260124113314.113584-4-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
tools/testing/selftests/bpf/progs/test_sockmap_pass_prog.c