summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorArchana Polampalli <archana.polampalli@windriver.com>2025-10-08 16:18:30 +0530
committerGyorgy Sarvari <skandigraun@gmail.com>2025-10-17 10:51:26 +0200
commitb6c9eb2ce5dba2a1794b761e49ccc0556362475e (patch)
treef1568faba945980ec21437c4d229b973b812f322 /meta-networking
parent0538af085a47b038e369db9872ffed8945b200c2 (diff)
downloadmeta-openembedded-b6c9eb2ce5dba2a1794b761e49ccc0556362475e.tar.gz
tcpreplay: fix CVE-2025-51006
Within tcpreplay's tcprewrite, a double free vulnerability has been identified in the dlt_linuxsll2_cleanup() function in plugins/dlt_linuxsll2/linuxsll2.c. This vulnerability is triggered when tcpedit_dlt_cleanup() indirectly invokes the cleanup routine multiple times on the same memory region. By supplying a specifically crafted pcap file to the tcprewrite binary, a local attacker can exploit this flaw to cause a Denial of Service (DoS) via memory corruption. Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-support/tcpreplay/tcpreplay/CVE-2025-51006.patch97
-rw-r--r--meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb1
2 files changed, 98 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay/CVE-2025-51006.patch b/meta-networking/recipes-support/tcpreplay/tcpreplay/CVE-2025-51006.patch
new file mode 100644
index 0000000000..a55ac8c314
--- /dev/null
+++ b/meta-networking/recipes-support/tcpreplay/tcpreplay/CVE-2025-51006.patch
@@ -0,0 +1,97 @@
1From 868db118535a646a8a48c957f1e6367069be1aa7 Mon Sep 17 00:00:00 2001
2From: Fred Klassen <fred.klassen@broadcom.com>
3Date: Wed, 9 Jul 2025 21:01:12 -0700
4Subject: [PATCH] Bug #902 juniper: added safeguards Protect against invalid or
5 unsupported Juniper packets.
6
7Notes:
8
9- only Ethernet packets are currently supported
10- was unable to recreate the original bug, but areas where hardening was required
11
12CVE: CVE-2025-51006
13
14Upstream-Status: Backport [https://github.com/appneta/tcpreplay/commit/868db118535a646a8a48c957f1e6367069be1aa7]
15
16Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
17---
18 .../plugins/dlt_jnpr_ether/jnpr_ether.c | 33 +++++++++++++++++--
19 .../plugins/dlt_jnpr_ether/jnpr_ether.h | 2 ++
20 2 files changed, 33 insertions(+), 2 deletions(-)
21
22diff --git a/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c b/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c
23index 9642a2c..671d5c0 100644
24--- a/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c
25+++ b/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c
26@@ -202,8 +202,12 @@ dlt_jnpr_ether_parse_opts(tcpeditdlt_t *ctx)
27 int
28 dlt_jnpr_ether_decode(tcpeditdlt_t *ctx, const u_char *packet, int pktlen)
29 {
30+ int extensions_len = 0;
31 int jnpr_header_len = 0;
32 const u_char *ethernet = NULL;
33+ const u_char *extension;
34+ u_char dlt = 0;
35+ u_char encapsulation = 0;
36 jnpr_ether_config_t *config;
37
38 assert(ctx);
39@@ -228,9 +232,10 @@ dlt_jnpr_ether_decode(tcpeditdlt_t *ctx, const u_char *packet, int pktlen)
40 }
41
42 /* then get the Juniper header length */
43- memcpy(&jnpr_header_len, &packet[JUNIPER_ETHER_EXTLEN_OFFSET], 2);
44+ memcpy(&extensions_len, &packet[JUNIPER_ETHER_EXTLEN_OFFSET], 2);
45
46- jnpr_header_len = ntohs(jnpr_header_len) + JUNIPER_ETHER_HEADER_LEN;
47+ extensions_len = ntohs(extensions_len);
48+ jnpr_header_len = extensions_len + JUNIPER_ETHER_HEADER_LEN;
49
50 dbgx(1, "jnpr header len: %d", jnpr_header_len);
51 /* make sure the packet is big enough to find the Ethernet Header */
52@@ -245,6 +250,30 @@ dlt_jnpr_ether_decode(tcpeditdlt_t *ctx, const u_char *packet, int pktlen)
53 /* jump to the appropriate offset */
54 ethernet = packet + jnpr_header_len;
55
56+ /* parse the extension header to ensure this is Ethernet - the only DLT we currently support */
57+ extension = packet + JUNIPER_ETHER_HEADER_LEN;
58+ while (extension < ethernet - 2) {
59+ u_char ext_len = extension[1];
60+ if (extension[0] == JUNIPER_ETHER_EXT_MEDIA_TYPE)
61+ dlt = extension[2];
62+ else if (extension[0] == JUNIPER_ETHER_EXT_ENCAPSULATION)
63+ encapsulation = extension[2];
64+ if (dlt != 0 && encapsulation != 0)
65+ break;
66+ extension += ext_len + 2;
67+ }
68+
69+ if (extension > ethernet) {
70+ tcpedit_seterr(ctx->tcpedit, "Extension to long! %d", extension - ethernet);
71+ return TCPEDIT_ERROR;
72+ }
73+
74+ if (dlt != DLT_EN10MB || encapsulation != 14) {
75+ tcpedit_setwarn(ctx->tcpedit, "packet DLT %d and extension type %d not supported",
76+ dlt, extension);
77+ return TCPEDIT_WARN;
78+ }
79+
80 /* let the en10mb plugin decode the rest */
81 if (tcpedit_dlt_decode(config->subctx, ethernet, (pktlen - jnpr_header_len)) == TCPEDIT_ERROR)
82 return TCPEDIT_ERROR;
83diff --git a/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.h b/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.h
84index 4875350..90c12b4 100644
85--- a/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.h
86+++ b/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.h
87@@ -33,6 +33,8 @@ extern "C" {
88 #define JUNIPER_ETHER_L2PRESENT 0x80
89 #define JUNIPER_ETHER_DIRECTION 0x01
90 #define JUNIPER_ETHER_EXTLEN_OFFSET 4
91+#define JUNIPER_ETHER_EXT_MEDIA_TYPE 3
92+#define JUNIPER_ETHER_EXT_ENCAPSULATION 6
93
94 int dlt_jnpr_ether_register(tcpeditdlt_t *ctx);
95 int dlt_jnpr_ether_init(tcpeditdlt_t *ctx);
96--
972.40.0
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb b/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb
index c2edd29524..29207bc89f 100644
--- a/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb
+++ b/meta-networking/recipes-support/tcpreplay/tcpreplay_4.4.4.bb
@@ -14,6 +14,7 @@ SRC_URI = "https://github.com/appneta/tcpreplay/releases/download/v${PV}/tcprepl
14 file://CVE-2024-22654-0002.patch \ 14 file://CVE-2024-22654-0002.patch \
15 file://CVE-2023-43279.patch \ 15 file://CVE-2023-43279.patch \
16 file://CVE-2025-9157.patch \ 16 file://CVE-2025-9157.patch \
17 file://CVE-2025-51006.patch \
17" 18"
18 19
19SRC_URI[sha256sum] = "44f18fb6d3470ecaf77a51b901a119dae16da5be4d4140ffbb2785e37ad6d4bf" 20SRC_URI[sha256sum] = "44f18fb6d3470ecaf77a51b901a119dae16da5be4d4140ffbb2785e37ad6d4bf"