* [PATCH] selftests/net: fix kill() argument order in fin_ack_lat
@ 2026-08-17 9:10 Qingshuang Fu
0 siblings, 0 replies; only message in thread
From: Qingshuang Fu @ 2026-08-17 9:10 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Shuah Khan, SeongJae Park
Cc: netdev, linux-kselftest, linux-kernel, Qingshuang Fu,
Qingshuang Fu
From: Qingshuang Fu <fuqingshuang@kylinos.cn>
sig_handler() passes its arguments to kill() in the wrong order: it
sends signal number child_pid to PID SIGTERM (15) instead of sending
SIGTERM to the client process. The call therefore always fails
(a pid is virtually never a valid signal number) and the client is
never notified: when only the server process receives SIGTERM, the
client keeps running its infinite connect loop as an orphan process.
Swap the arguments so that the server forwards SIGTERM to the client.
Also guard the call with child_pid > 0: the client inherits the
handler and sees child_pid == 0, and a plain argument swap would make
it call kill(0, SIGTERM), signaling the whole process group (including
the invoking shell) instead of exiting quietly.
Fixes: af8c8a450bf4 ("selftests: net: Add FIN_ACK processing order related latency spike test")
Signed-off-by: Qingshuang Fu <fuqingshuang@kylinos.cn>
---
tools/testing/selftests/net/fin_ack_lat.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/fin_ack_lat.c b/tools/testing/selftests/net/fin_ack_lat.c
index 70187494b57a..f985e01354b4 100644
--- a/tools/testing/selftests/net/fin_ack_lat.c
+++ b/tools/testing/selftests/net/fin_ack_lat.c
@@ -103,7 +103,8 @@ static void server(int sock, struct sockaddr_in address)
static void sig_handler(int signum)
{
- kill(SIGTERM, child_pid);
+ if (child_pid > 0)
+ kill(child_pid, SIGTERM);
exit(0);
}
base-commit: 8d3ae59288f1e7d58d76558a6ee96d533bc5019f
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-17 9:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-17 9:10 [PATCH] selftests/net: fix kill() argument order in fin_ack_lat Qingshuang Fu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox