selftests/bpf: Add negtive test cases for task iter
authorYafang Shao <laoar.shao@gmail.com>
Sat, 17 Feb 2024 11:41:52 +0000 (19:41 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 19 Feb 2024 11:28:15 +0000 (12:28 +0100)
commit5c138a8a4abe152fcbef1ed40a6a4b5727b2991b
treec9aee41673c07d98b333e9ab9e87d7b0535bb9bd
parent5f2ae606cb5a90839a9be9d22388c4200f820e75
selftests/bpf: Add negtive test cases for task iter

Incorporate a test case to assess the handling of invalid flags or
task__nullable parameters passed to bpf_iter_task_new(). Prior to the
preceding commit, this scenario could potentially trigger a kernel panic.
However, with the previous commit, this test case is expected to function
correctly.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240217114152.1623-3-laoar.shao@gmail.com
tools/testing/selftests/bpf/prog_tests/iters.c
tools/testing/selftests/bpf/progs/iters_task.c