summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vorel <petr.vorel@gmail.com>2025-06-08 23:01:52 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-09 17:43:41 +0100
commita1dea36e9cb5daf92516a6ba441a469067d8022c (patch)
tree9cc2dc31ffeda7519d0173378291a6d4113d1481
parentef6748323f7aefebce8baa2ebb609d8ba0900f4c (diff)
downloadpoky-a1dea36e9cb5daf92516a6ba441a469067d8022c.tar.gz
iputils: upgrade 20240905 -> 20250605
Bugfix release: https://github.com/iputils/iputils/releases/tag/20250605 This also includes security release update https://github.com/iputils/iputils/releases/tag/20250602 Security release, fixes CVE-2025-47268 and CVE-2025-48964 (therefore remove backported fix CVE-2025-47268.patch (From OE-Core rev: 846b7dcb5a41ec017581913bb438d43d1d59109f) Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/iputils/iputils/CVE-2025-47268.patch143
-rw-r--r--meta/recipes-extended/iputils/iputils_20250605.bb (renamed from meta/recipes-extended/iputils/iputils_20240905.bb)3
2 files changed, 1 insertions, 145 deletions
diff --git a/meta/recipes-extended/iputils/iputils/CVE-2025-47268.patch b/meta/recipes-extended/iputils/iputils/CVE-2025-47268.patch
deleted file mode 100644
index dd31b79031..0000000000
--- a/meta/recipes-extended/iputils/iputils/CVE-2025-47268.patch
+++ /dev/null
@@ -1,143 +0,0 @@
1From 070cfacd7348386173231fb16fad4983d4e6ae40 Mon Sep 17 00:00:00 2001
2From: Petr Vorel <pvorel@suse.cz>
3Date: Mon, 5 May 2025 23:55:57 +0200
4Subject: [PATCH] ping: Fix signed 64-bit integer overflow in RTT calculation
5
6Crafted ICMP Echo Reply packet can cause signed integer overflow in
7
81) triptime calculation:
9triptime = tv->tv_sec * 1000000 + tv->tv_usec;
10
112) tsum2 increment which uses triptime
12rts->tsum2 += (double)((long long)triptime * (long long)triptime);
13
143) final tmvar:
15tmvar = (rts->tsum2 / total) - (tmavg * tmavg)
16
17 $ export CFLAGS="-O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer"
18 $ export LDFLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer"
19 $ meson setup .. -Db_sanitize=address,undefined
20 $ ninja
21 $ ./ping/ping -c2 127.0.0.1
22
23 PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
24 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.061 ms
25 ../ping/ping_common.c:757:25: runtime error: signed integer overflow: -2513732689199106 * 1000000 cannot be represented in type 'long int'
26 ../ping/ping_common.c:757:12: runtime error: signed integer overflow: -4975495174606980224 + -6510615555425289427 cannot be represented in type 'long int'
27 ../ping/ping_common.c:769:47: runtime error: signed integer overflow: 6960633343677281965 * 6960633343677281965 cannot be represented in type 'long int'
28 24 bytes from 127.0.0.1: icmp_seq=1 ttl=64 (truncated)
29 ./ping/ping: Warning: time of day goes back (-7256972569576721377us), taking countermeasures
30 ./ping/ping: Warning: time of day goes back (-7256972569576721232us), taking countermeasures
31 24 bytes from 127.0.0.1: icmp_seq=1 ttl=64 (truncated)
32 ../ping/ping_common.c:265:16: runtime error: signed integer overflow: 6960633343677281965 * 2 cannot be represented in type 'long int'
33 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.565 ms
34
35 --- 127.0.0.1 ping statistics ---
36 2 packets transmitted, 2 received, +2 duplicates, 0% packet loss, time 1002ms
37 ../ping/ping_common.c:940:42: runtime error: signed integer overflow: 1740158335919320832 * 1740158335919320832 cannot be represented in type 'long int'
38 rtt min/avg/max/mdev = 0.000/1740158335919320.832/6960633343677281.965/-1623514645242292.-224 ms
39
40To fix the overflow check allowed ranges of struct timeval members:
41* tv_sec <0, LONG_MAX/1000000>
42* tv_usec <0, 999999>
43
44Fix includes 2 new error messages (needs translation).
45Also existing message "time of day goes back ..." needed to be modified
46as it now prints tv->tv_sec which is a second (needs translation update).
47
48After fix:
49
50 $ ./ping/ping -c2 127.0.0.1
51 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.057 ms
52 ./ping/ping: Warning: invalid tv_usec -6510615555424928611 us
53 ./ping/ping: Warning: time of day goes back (-3985394643238914 s), taking countermeasures
54 ./ping/ping: Warning: invalid tv_usec -6510615555424928461 us
55 ./ping/ping: Warning: time of day goes back (-3985394643238914 s), taking countermeasures
56 24 bytes from 127.0.0.1: icmp_seq=1 ttl=64 (truncated)
57 ./ping/ping: Warning: invalid tv_usec -6510615555425884541 us
58 ./ping/ping: Warning: time of day goes back (-4243165695442945 s), taking countermeasures
59 24 bytes from 127.0.0.1: icmp_seq=1 ttl=64 (truncated)
60 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.111 ms
61
62 --- 127.0.0.1 ping statistics ---
63 2 packets transmitted, 2 received, +2 duplicates, 0% packet loss, time 101ms
64 rtt min/avg/max/mdev = 0.000/0.042/0.111/0.046 ms
65
66Fixes: https://github.com/iputils/iputils/issues/584
67Fixes: CVE-2025-472
68Link: https://github.com/Zephkek/ping-rtt-overflow/
69Co-developed-by: Cyril Hrubis <chrubis@suse.cz>
70Reported-by: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com>
71Reviewed-by: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com>
72Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
73Reviewed-by: Noah Meyerhans <noahm@debian.org>
74Signed-off-by: Petr Vorel <pvorel@suse.cz>
75
76CVE: CVE-2025-47268
77
78Upstream-Status: Backport
79[https://github.com/iputils/iputils/commit/070cfacd7348386173231fb16fad4983d4e6ae40]
80
81Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
82---
83 iputils_common.h | 3 +++
84 ping/ping_common.c | 22 +++++++++++++++++++---
85 2 files changed, 22 insertions(+), 3 deletions(-)
86
87diff --git a/iputils_common.h b/iputils_common.h
88index 49e790d..829a749 100644
89--- a/iputils_common.h
90+++ b/iputils_common.h
91@@ -10,6 +10,9 @@
92 !!__builtin_types_compatible_p(__typeof__(arr), \
93 __typeof__(&arr[0]))])) * 0)
94
95+/* 1000001 = 1000000 tv_sec + 1 tv_usec */
96+#define TV_SEC_MAX_VAL (LONG_MAX/1000001)
97+
98 #ifdef __GNUC__
99 # define iputils_attribute_format(t, n, m) __attribute__((__format__ (t, n, m)))
100 #else
101diff --git a/ping/ping_common.c b/ping/ping_common.c
102index dadd2a4..4e99d89 100644
103--- a/ping/ping_common.c
104+++ b/ping/ping_common.c
105@@ -754,16 +754,32 @@ int gather_statistics(struct ping_rts *rts, uint8_t *icmph, int icmplen,
106
107 restamp:
108 tvsub(tv, &tmp_tv);
109- triptime = tv->tv_sec * 1000000 + tv->tv_usec;
110- if (triptime < 0) {
111- error(0, 0, _("Warning: time of day goes back (%ldus), taking countermeasures"), triptime);
112+
113+ if (tv->tv_usec >= 1000000) {
114+ error(0, 0, _("Warning: invalid tv_usec %ld us"), tv->tv_usec);
115+ tv->tv_usec = 999999;
116+ }
117+
118+ if (tv->tv_usec < 0) {
119+ error(0, 0, _("Warning: invalid tv_usec %ld us"), tv->tv_usec);
120+ tv->tv_usec = 0;
121+ }
122+
123+ if (tv->tv_sec > TV_SEC_MAX_VAL) {
124+ error(0, 0, _("Warning: invalid tv_sec %ld s"), tv->tv_sec);
125+ triptime = 0;
126+ } else if (tv->tv_sec < 0) {
127+ error(0, 0, _("Warning: time of day goes back (%ld s), taking countermeasures"), tv->tv_sec);
128 triptime = 0;
129 if (!rts->opt_latency) {
130 gettimeofday(tv, NULL);
131 rts->opt_latency = 1;
132 goto restamp;
133 }
134+ } else {
135+ triptime = tv->tv_sec * 1000000 + tv->tv_usec;
136 }
137+
138 if (!csfailed) {
139 rts->tsum += triptime;
140 rts->tsum2 += (double)((long long)triptime * (long long)triptime);
141--
1422.34.1
143
diff --git a/meta/recipes-extended/iputils/iputils_20240905.bb b/meta/recipes-extended/iputils/iputils_20250605.bb
index 64d58a91c2..a62ea65ba8 100644
--- a/meta/recipes-extended/iputils/iputils_20240905.bb
+++ b/meta/recipes-extended/iputils/iputils_20250605.bb
@@ -11,9 +11,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=627cc07ec86a45951d43e30658bbd819"
11DEPENDS = "gnutls" 11DEPENDS = "gnutls"
12 12
13SRC_URI = "git://github.com/iputils/iputils;branch=master;protocol=https \ 13SRC_URI = "git://github.com/iputils/iputils;branch=master;protocol=https \
14 file://CVE-2025-47268.patch \
15 " 14 "
16SRCREV = "10b50784aae3fb75c96cdf9b1668916b49557dd5" 15SRCREV = "6e1cb146547eb6fbb127ffc8397a9241be0d33c2"
17 16
18S = "${WORKDIR}/git" 17S = "${WORKDIR}/git"
19 18