]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix spurious test failures in core_retro selftest
authorAndrii Nakryiko <andriin@fb.com>
Fri, 31 Jul 2020 20:49:57 +0000 (13:49 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 2 Aug 2020 06:10:42 +0000 (23:10 -0700)
commit26616d48ec9f7bf84586c1d323bc4098afe2699e
tree0ffeb2e274d95724b100c61ae7d1a9770a7ef259
parent0e6b5866211d4ced95852c448f38a85a49c1cf2e
selftests/bpf: Fix spurious test failures in core_retro selftest

core_retro selftest uses BPF program that's triggered on sys_enter
system-wide, but has no protection from some unrelated process doing syscall
while selftest is running. This leads to occasional test failures with
unexpected PIDs being returned. Fix that by filtering out all processes that
are not test_progs process.

Fixes: eb1c980e3919 ("selftests/bpf: Add test relying only on CO-RE and no recent kernel features")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200731204957.2047119-1-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/core_retro.c
tools/testing/selftests/bpf/progs/test_core_retro.c