diff options
| author | Peter Marko <peter.marko@siemens.com> | 2025-07-14 00:00:49 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-07-18 08:32:26 -0700 |
| commit | 86182e972c5e7308a0f01ba1c3059f792e993d61 (patch) | |
| tree | a029fcd1483732643e979596f66f11965b45fa1b /meta/recipes-extended | |
| parent | e8aec82955d124f92cc1e0abc633ab41ac70a2ba (diff) | |
| download | poky-86182e972c5e7308a0f01ba1c3059f792e993d61.tar.gz | |
iputils: patch CVE-2025-48964
Pick commit referencing this CVE.
(From OE-Core rev: 49ccf7b56a0598f84dcac2532c462aa2c285f66c)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-extended')
| -rw-r--r-- | meta/recipes-extended/iputils/iputils/CVE-2025-48964.patch | 99 | ||||
| -rw-r--r-- | meta/recipes-extended/iputils/iputils_20211215.bb | 1 |
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..e6fc67bce0 --- /dev/null +++ b/meta/recipes-extended/iputils/iputils/CVE-2025-48964.patch | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | From afa36390394a6e0cceba03b52b59b6d41710608c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Cyril Hrubis <metan@ucw.cz> | ||
| 3 | Date: Fri, 16 May 2025 17:57:10 +0200 | ||
| 4 | Subject: [PATCH] ping: Fix moving average rtt calculation | ||
| 5 | |||
| 6 | The rts->rtt counts an exponential weight moving average in a fixed | ||
| 7 | point, that means that even if we limit the triptime to fit into a 32bit | ||
| 8 | number the average will overflow because because fixed point needs eight | ||
| 9 | more bits. | ||
| 10 | |||
| 11 | We also have to limit the triptime to 32bit number because otherwise the | ||
| 12 | moving average may stil overflow if we manage to produce a large enough | ||
| 13 | triptime. | ||
| 14 | |||
| 15 | Fixes: CVE-2025-48964 | ||
| 16 | Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1243772 | ||
| 17 | Closes: https://github.com/iputils/iputils-ghsa-25fr-jw29-74f9/pull/1 | ||
| 18 | Reported-by: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com> | ||
| 19 | Reviewed-by: Petr Vorel <pvorel@suse.cz> | ||
| 20 | Tested-by: Petr Vorel <pvorel@suse.cz> | ||
| 21 | Reviewed-by: Michal Kubecek <mkubecek@suse.cz> | ||
| 22 | Reviewed-by: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com> | ||
| 23 | Signed-off-by: Cyril Hrubis <metan@ucw.cz> | ||
| 24 | |||
| 25 | CVE: CVE-2025-48964 | ||
| 26 | Upstream-Status: Backport [https://github.com/iputils/iputils/commit/afa36390394a6e0cceba03b52b59b6d41710608c] | ||
| 27 | Signed-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 | |||
| 34 | diff --git a/iputils_common.h b/iputils_common.h | ||
| 35 | index 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))) | ||
| 47 | diff --git a/ping/ping.h b/ping/ping.h | ||
| 48 | index 4dce538..bc1fab2 100644 | ||
| 49 | --- a/ping/ping.h | ||
| 50 | +++ b/ping/ping.h | ||
| 51 | @@ -180,7 +180,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; | ||
| 60 | diff --git a/ping/ping_common.c b/ping/ping_common.c | ||
| 61 | index 2a3e556..fad5228 100644 | ||
| 62 | --- a/ping/ping_common.c | ||
| 63 | +++ b/ping/ping_common.c | ||
| 64 | @@ -273,7 +273,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 < MINUSERINTERVAL) | ||
| 73 | @@ -768,7 +768,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 | @@ -935,7 +935,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 | @@ -960,7 +960,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_20211215.bb b/meta/recipes-extended/iputils/iputils_20211215.bb index 03dc97dcc8..97fff6fe3a 100644 --- a/meta/recipes-extended/iputils/iputils_20211215.bb +++ b/meta/recipes-extended/iputils/iputils_20211215.bb | |||
| @@ -13,6 +13,7 @@ DEPENDS = "gnutls" | |||
| 13 | SRC_URI = "git://github.com/iputils/iputils;branch=master;protocol=https \ | 13 | SRC_URI = "git://github.com/iputils/iputils;branch=master;protocol=https \ |
| 14 | file://0001-rarpd-rdisc-Drop-PrivateUsers.patch \ | 14 | file://0001-rarpd-rdisc-Drop-PrivateUsers.patch \ |
| 15 | file://CVE-2025-47268.patch \ | 15 | file://CVE-2025-47268.patch \ |
| 16 | file://CVE-2025-48964.patch \ | ||
| 16 | " | 17 | " |
| 17 | SRCREV = "1d1e7c43210d8af316a41cb2c53d612a4c16f34d" | 18 | SRCREV = "1d1e7c43210d8af316a41cb2c53d612a4c16f34d" |
| 18 | 19 | ||
