summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2025-07-14 00:01:39 +0200
committerSteve Sakoman <steve@sakoman.com>2025-07-21 09:07:21 -0700
commit83ba9772501cd6e4126c71e45ac6d77c3326e43e (patch)
tree4b5a3de57f6392413f81b8a10cc2449ceb8351a8
parentef6f8d5f462eea3921baad31982e8fa3fac56286 (diff)
downloadpoky-83ba9772501cd6e4126c71e45ac6d77c3326e43e.tar.gz
iputils: patch CVE-2025-48964
Pick commit referencing this CVE. (From OE-Core rev: a8193571c8cdba55f568d831a4546e0fed892be0) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-extended/iputils/iputils/CVE-2025-48964.patch99
-rw-r--r--meta/recipes-extended/iputils/iputils_20240117.bb1
2 files changed, 100 insertions, 0 deletions
diff --git a/meta/recipes-extended/iputils/iputils/CVE-2025-48964.patch b/meta/recipes-extended/iputils/iputils/CVE-2025-48964.patch
new file mode 100644
index 0000000000..fc2352c99c
--- /dev/null
+++ b/meta/recipes-extended/iputils/iputils/CVE-2025-48964.patch
@@ -0,0 +1,99 @@
1From afa36390394a6e0cceba03b52b59b6d41710608c Mon Sep 17 00:00:00 2001
2From: Cyril Hrubis <metan@ucw.cz>
3Date: Fri, 16 May 2025 17:57:10 +0200
4Subject: [PATCH] ping: Fix moving average rtt calculation
5
6The rts->rtt counts an exponential weight moving average in a fixed
7point, that means that even if we limit the triptime to fit into a 32bit
8number the average will overflow because because fixed point needs eight
9more bits.
10
11We also have to limit the triptime to 32bit number because otherwise the
12moving average may stil overflow if we manage to produce a large enough
13triptime.
14
15Fixes: CVE-2025-48964
16Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1243772
17Closes: https://github.com/iputils/iputils-ghsa-25fr-jw29-74f9/pull/1
18Reported-by: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com>
19Reviewed-by: Petr Vorel <pvorel@suse.cz>
20Tested-by: Petr Vorel <pvorel@suse.cz>
21Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
22Reviewed-by: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com>
23Signed-off-by: Cyril Hrubis <metan@ucw.cz>
24
25CVE: CVE-2025-48964
26Upstream-Status: Backport [https://github.com/iputils/iputils/commit/afa36390394a6e0cceba03b52b59b6d41710608c]
27Signed-off-by: Peter Marko <peter.marko@siemens.com>
28---
29 iputils_common.h | 2 +-
30 ping/ping.h | 2 +-
31 ping/ping_common.c | 8 ++++----
32 3 files changed, 6 insertions(+), 6 deletions(-)
33
34diff --git a/iputils_common.h b/iputils_common.h
35index 829a749..1296905 100644
36--- a/iputils_common.h
37+++ b/iputils_common.h
38@@ -11,7 +11,7 @@
39 __typeof__(&arr[0]))])) * 0)
40
41 /* 1000001 = 1000000 tv_sec + 1 tv_usec */
42-#define TV_SEC_MAX_VAL (LONG_MAX/1000001)
43+#define TV_SEC_MAX_VAL (INT32_MAX/1000001)
44
45 #ifdef __GNUC__
46 # define iputils_attribute_format(t, n, m) __attribute__((__format__ (t, n, m)))
47diff --git a/ping/ping.h b/ping/ping.h
48index 4dce538..bc1fab2 100644
49--- a/ping/ping.h
50+++ b/ping/ping.h
51@@ -191,7 +191,7 @@ struct ping_rts {
52 long tmax; /* maximum round trip time */
53 double tsum; /* sum of all times, for doing average */
54 double tsum2;
55- int rtt;
56+ uint64_t rtt; /* Exponential weight moving average calculated in fixed point */
57 int rtt_addend;
58 uint16_t acked;
59 int pipesize;
60diff --git a/ping/ping_common.c b/ping/ping_common.c
61index 2a3e556..fad5228 100644
62--- a/ping/ping_common.c
63+++ b/ping/ping_common.c
64@@ -282,7 +282,7 @@ int __schedule_exit(int next)
65
66 static inline void update_interval(struct ping_rts *rts)
67 {
68- int est = rts->rtt ? rts->rtt / 8 : rts->interval * 1000;
69+ int est = rts->rtt ? (int)(rts->rtt / 8) : rts->interval * 1000;
70
71 rts->interval = (est + rts->rtt_addend + 500) / 1000;
72 if (rts->uid && rts->interval < MIN_USER_INTERVAL_MS)
73@@ -778,7 +778,7 @@ restamp:
74 if (triptime > rts->tmax)
75 rts->tmax = triptime;
76 if (!rts->rtt)
77- rts->rtt = triptime * 8;
78+ rts->rtt = ((uint64_t)triptime) * 8;
79 else
80 rts->rtt += triptime - rts->rtt / 8;
81 if (rts->opt_adaptive)
82@@ -948,7 +948,7 @@ int finish(struct ping_rts *rts)
83 int ipg = (1000000 * (long long)tv.tv_sec + tv.tv_nsec / 1000) / (rts->ntransmitted - 1);
84
85 printf(_("%sipg/ewma %d.%03d/%d.%03d ms"),
86- comma, ipg / 1000, ipg % 1000, rts->rtt / 8000, (rts->rtt / 8) % 1000);
87+ comma, ipg / 1000, ipg % 1000, (int)(rts->rtt / 8000), (int)((rts->rtt / 8) % 1000));
88 }
89 putchar('\n');
90 return (!rts->nreceived || (rts->deadline && rts->nreceived < rts->npackets));
91@@ -973,7 +973,7 @@ void status(struct ping_rts *rts)
92 fprintf(stderr, _(", min/avg/ewma/max = %ld.%03ld/%lu.%03ld/%d.%03d/%ld.%03ld ms"),
93 (long)rts->tmin / 1000, (long)rts->tmin % 1000,
94 tavg / 1000, tavg % 1000,
95- rts->rtt / 8000, (rts->rtt / 8) % 1000, (long)rts->tmax / 1000, (long)rts->tmax % 1000);
96+ (int)(rts->rtt / 8000), (int)((rts->rtt / 8) % 1000), (long)rts->tmax / 1000, (long)rts->tmax % 1000);
97 }
98 fprintf(stderr, "\n");
99 }
diff --git a/meta/recipes-extended/iputils/iputils_20240117.bb b/meta/recipes-extended/iputils/iputils_20240117.bb
index 5ff5af8847..21494cae2b 100644
--- a/meta/recipes-extended/iputils/iputils_20240117.bb
+++ b/meta/recipes-extended/iputils/iputils_20240117.bb
@@ -12,6 +12,7 @@ DEPENDS = "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 \ 14 file://CVE-2025-47268.patch \
15 file://CVE-2025-48964.patch \
15 " 16 "
16SRCREV = "8372f355bdf7a9b0c79338dd8ef8464c00a5c4e2" 17SRCREV = "8372f355bdf7a9b0c79338dd8ef8464c00a5c4e2"
17 18