]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Fix failure paths in send_signal test
authorAlexei Starovoitov <ast@kernel.org>
Thu, 13 Nov 2025 17:11:53 +0000 (09:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:29 +0000 (13:09 +0100)
commitf93b75779dc079fd74702d9d9002e0c9f7917ea9
tree053e76dddf0b12a9e887a4ee61ae40fcd9c95fd4
parentcf31d9fc454f891fc6d0ea3469aa1f359d85d6aa
selftests/bpf: Fix failure paths in send_signal test

[ Upstream commit c13339039891dbdfa6c1972f0483bd07f610b776 ]

When test_send_signal_kern__open_and_load() fails parent closes the
pipe which cases ASSERT_EQ(read(pipe_p2c...)) to fail, but child
continues and enters infinite loop, while parent is stuck in wait(NULL).
Other error paths have similar issue, so kill the child before waiting on it.

The bug was discovered while compiling all of selftests with -O1 instead of -O2
which caused progs/test_send_signal_kern.c to fail to load.

Fixes: ab8b7f0cb358 ("tools/bpf: Add self tests for bpf_send_signal_thread()")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20251113171153.2583-1-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/send_signal.c