From: Qingshuang Fu <fffsqian@163.com>
To: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
SeongJae Park <sjpark@amazon.de>
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Qingshuang Fu <fuqingshuang@kylinos.cn>,
Qingshuang Fu <fffsqian@163.com>
Subject: [PATCH] selftests/net: fix kill() argument order in fin_ack_lat
Date: Mon, 17 Aug 2026 17:10:17 +0800 [thread overview]
Message-ID: <20260817091017.281104-1-fffsqian@163.com> (raw)
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
next reply other threads:[~2026-08-17 9:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 9:10 Qingshuang Fu [this message]
2026-08-20 10:57 ` [PATCH] selftests/net: fix kill() argument order in fin_ack_lat Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260817091017.281104-1-fffsqian@163.com \
--to=fffsqian@163.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fuqingshuang@kylinos.cn \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=sjpark@amazon.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.