From ec893a4c20cc211919e237e8acd6d467e83c6170 Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Thu, 19 Jun 2025 15:56:13 +0200 Subject: [PATCH] Fix ping hangs under ASan on aarch64 Resolves: RHEL-96871 --- 014-ping-Make-ping_rts-struct-static.patch | 38 ++++++++++++++++++++++ iputils.spec | 6 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 014-ping-Make-ping_rts-struct-static.patch diff --git a/014-ping-Make-ping_rts-struct-static.patch b/014-ping-Make-ping_rts-struct-static.patch new file mode 100644 index 0000000..2893aa2 --- /dev/null +++ b/014-ping-Make-ping_rts-struct-static.patch @@ -0,0 +1,38 @@ +From 68bdc8e127f1f02aa742b324d1cf3c89d251e13b Mon Sep 17 00:00:00 2001 +From: Petr Vorel +Date: Tue, 20 Sep 2022 22:23:44 +0200 +Subject: [PATCH] ping: Make ping_rts struct static + +This allows accessing global_rts->exiting in sigexit() signal handler +after main() has exited. Problem occurred on aarch64, which occasionally +delivered signal after main() has exited, which causes segfault. + +Fixes: b3a41a6 ("ping: move global variables to runtime config structure") +Fixes: https://github.com/iputils/iputils/issues/423 +Closes: https://github.com/iputils/iputils/pull/425 + +Reported-by: linzhanglong +Suggested-by: Cyril Hrubis +Reviewed-by: Cyril Hrubis +Signed-off-by: Petr Vorel +(cherry picked from commit 7861af993bf47fccaf37c5659d66c09832844ae3) +--- + ping/ping.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ping/ping.c b/ping/ping.c +index ff7e742..19913e6 100644 +--- a/ping/ping.c ++++ b/ping/ping.c +@@ -263,7 +263,7 @@ main(int argc, char **argv) + socket_st sock6 = { .fd = -1 }; + char *target; + char *outpack_fill = NULL; +- struct ping_rts rts = { ++ static struct ping_rts rts = { + .interval = 1000, + .preload = 1, + .lingertime = MAXWAIT * 1000, +-- +2.49.0 + diff --git a/iputils.spec b/iputils.spec index 620b507..a44d86d 100644 --- a/iputils.spec +++ b/iputils.spec @@ -3,7 +3,7 @@ Summary: Network monitoring tools including ping Name: iputils Version: 20210202 -Release: 12%{?dist} +Release: 13%{?dist} # some parts are under the original BSD (ping.c) # some are under GPLv2+ (tracepath.c) License: BSD and GPLv2+ @@ -32,6 +32,7 @@ Patch010: 010-ping-Fix-socket-error-reporting.patch Patch011: 011-ping-Fix-ping6-binding-to-VRF-and-address.patch Patch012: 012-ping6-Avoid-binding-to-non-VRF.patch Patch013: 013-ping-Fix-signed-64-bit-integer-overflow-in-RTT-calcu.patch +Patch014: 014-ping-Make-ping_rts-struct-static.patch # Downstream-only patches Patch100: 100-iputils-ifenslave.patch @@ -142,6 +143,9 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ %attr(644,root,root) %{_mandir}/man8/ninfod.8.gz %changelog +* Thu Jun 19 2025 Jan Macku - 20210202-13 +- Fix ping hangs under ASan on aarch64 (RHEL-96871) + * Tue Jun 03 2025 Jan Macku - 20210202-12 - Fix CVE-2025-47268 iputils: Signed Integer Overflow in Timestamp Multiplication in iputils ping (RHEL-94334)