summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHitendra Prajapati <hprajapati@mvista.com>2023-06-27 17:53:33 +0530
committerArmin Kuster <akuster808@gmail.com>2023-07-14 07:08:54 -0400
commit205b72edaa8d3c52d75d43f42143c05e3c2763d4 (patch)
treed2b02a8c6c3a0e498b67363df9c07284bc848e3b
parent5f94e674795421b21fefc12f13c8152e7f6cf3d8 (diff)
downloadmeta-openembedded-205b72edaa8d3c52d75d43f42143c05e3c2763d4.tar.gz
wireshark: Fix CVE-2023-0667 & CVE-2023-0668
Backport fixes for: * CVE-2023-0667 - Upstream-Status: Backport from https://gitlab.com/wireshark/wireshark/-/commit/35418a73f7c9cefebe392b1ea0f012fccaf89801 && https://gitlab.com/wireshark/wireshark/-/commit/85fbca8adb09ea8e1af635db3d92727fbfa1e28a * CVE-2023-0668 - Upstream-Status: Backport from https://gitlab.com/wireshark/wireshark/-/commit/c4f37d77b29ec6a9754795d0efb6f68d633728d9 Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-networking/recipes-support/wireshark/files/CVE-2023-0667-pre1.patch153
-rw-r--r--meta-networking/recipes-support/wireshark/files/CVE-2023-0667.patch66
-rw-r--r--meta-networking/recipes-support/wireshark/files/CVE-2023-0668.patch33
-rw-r--r--meta-networking/recipes-support/wireshark/wireshark_3.2.18.bb3
4 files changed, 255 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/wireshark/files/CVE-2023-0667-pre1.patch b/meta-networking/recipes-support/wireshark/files/CVE-2023-0667-pre1.patch
new file mode 100644
index 0000000000..e6fc158c3a
--- /dev/null
+++ b/meta-networking/recipes-support/wireshark/files/CVE-2023-0667-pre1.patch
@@ -0,0 +1,153 @@
1From 35418a73f7c9cefebe392b1ea0f012fccaf89801 Mon Sep 17 00:00:00 2001
2From: Guy Harris <gharris@sonic.net>
3Date: Wed, 19 Aug 2020 23:58:20 -0700
4Subject: [PATCH] Add format_text_string(), which gets the length with
5 strlen().
6
7format_text(alloc, string, strlen(string)) is a common idiom; provide
8format_text_string(), which does the strlen(string) for you. (Any
9string used in a %s to set the text of a protocol tree item, if it was
10directly extracted from the packet, should be run through a format_text
11routine, to ensure that it's valid UTF-8 and that control characters are
12handled correctly.)
13
14Update comments while we're at it.
15
16Change-Id: Ia8549efa1c96510ffce97178ed4ff7be4b02eb6e
17Reviewed-on: https://code.wireshark.org/review/38202
18Petri-Dish: Guy Harris <gharris@sonic.net>
19Tested-by: Petri Dish Buildbot
20Reviewed-by: Guy Harris <gharris@sonic.net>
21
22Upstream-Status: Backport [https://gitlab.com/wireshark/wireshark/-/commit/35418a73f7c9cefebe392b1ea0f012fccaf89801]
23Comment: to backport fix for CVE-2023-0667, add function format_text_string().
24Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
25---
26 epan/strutil.c | 33 ++++++++++++++++++++++++++++----
27 epan/strutil.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++----
28 2 files changed, 76 insertions(+), 8 deletions(-)
29
30diff --git a/epan/strutil.c b/epan/strutil.c
31index 347a173..bc3b19e 100644
32--- a/epan/strutil.c
33+++ b/epan/strutil.c
34@@ -193,10 +193,11 @@ get_token_len(const guchar *linep, const guchar *lineend,
35 #define UNPOOP 0x1F4A9
36
37 /*
38- * Given a string, expected to be in UTF-8 but possibly containing
39- * invalid sequences (as it may have come from packet data), generate
40- * a valid UTF-8 string from it, allocated with the specified wmem
41- * allocator, that:
42+ * Given a wmem scope, a not-necessarily-null-terminated string,
43+ * expected to be in UTF-8 but possibly containing invalid sequences
44+ * (as it may have come from packet data), and the length of the string,
45+ * generate a valid UTF-8 string from it, allocated in the specified
46+ * wmem scope, that:
47 *
48 * shows printable Unicode characters as themselves;
49 *
50@@ -493,6 +494,30 @@ format_text(wmem_allocator_t* allocator, const guchar *string, size_t len)
51 return fmtbuf;
52 }
53
54+/** Given a wmem scope and a null-terminated string, expected to be in
55+ * UTF-8 but possibly containing invalid sequences (as it may have come
56+ * from packet data), and the length of the string, generate a valid
57+ * UTF-8 string from it, allocated in the specified wmem scope, that:
58+ *
59+ * shows printable Unicode characters as themselves;
60+ *
61+ * shows non-printable ASCII characters as C-style escapes (octal
62+ * if not one of the standard ones such as LF -> '\n');
63+ *
64+ * shows non-printable Unicode-but-not-ASCII characters as
65+ * their universal character names;
66+ *
67+ * shows illegal UTF-8 sequences as a sequence of bytes represented
68+ * as C-style hex escapes;
69+ *
70+ * and return a pointer to it.
71+ */
72+gchar *
73+format_text_string(wmem_allocator_t* allocator, const guchar *string)
74+{
75+ return format_text(allocator, string, strlen(string));
76+}
77+
78 /*
79 * Given a string, generate a string from it that shows non-printable
80 * characters as C-style escapes except a whitespace character
81diff --git a/epan/strutil.h b/epan/strutil.h
82index 2046cb0..705beb5 100644
83--- a/epan/strutil.h
84+++ b/epan/strutil.h
85@@ -46,18 +46,61 @@ WS_DLL_PUBLIC
86 int get_token_len(const guchar *linep, const guchar *lineend,
87 const guchar **next_token);
88
89-/** Given a string, generate a string from it that shows non-printable
90- * characters as C-style escapes, and return a pointer to it.
91+/** Given a wmem scope, a not-necessarily-null-terminated string,
92+ * expected to be in UTF-8 but possibly containing invalid sequences
93+ * (as it may have come from packet data), and the length of the string,
94+ * generate a valid UTF-8 string from it, allocated in the specified
95+ * wmem scope, that:
96+ *
97+ * shows printable Unicode characters as themselves;
98+ *
99+ * shows non-printable ASCII characters as C-style escapes (octal
100+ * if not one of the standard ones such as LF -> '\n');
101+ *
102+ * shows non-printable Unicode-but-not-ASCII characters as
103+ * their universal character names;
104+ *
105+ * shows illegal UTF-8 sequences as a sequence of bytes represented
106+ * as C-style hex escapes;
107+ *
108+ * and return a pointer to it.
109 *
110 * @param allocator The wmem scope
111- * @param line A pointer to the input string
112+ * @param string A pointer to the input string
113 * @param len The length of the input string
114 * @return A pointer to the formatted string
115 *
116 * @see tvb_format_text()
117 */
118 WS_DLL_PUBLIC
119-gchar* format_text(wmem_allocator_t* allocator, const guchar *line, size_t len);
120+gchar* format_text(wmem_allocator_t* allocator, const guchar *string, size_t len);
121+
122+/** Given a wmem scope and a null-terminated string, expected to be in
123+ * UTF-8 but possibly containing invalid sequences (as it may have come
124+ * from packet data), and the length of the string, generate a valid
125+ * UTF-8 string from it, allocated in the specified wmem scope, that:
126+ *
127+ * shows printable Unicode characters as themselves;
128+ *
129+ * shows non-printable ASCII characters as C-style escapes (octal
130+ * if not one of the standard ones such as LF -> '\n');
131+ *
132+ * shows non-printable Unicode-but-not-ASCII characters as
133+ * their universal character names;
134+ *
135+ * shows illegal UTF-8 sequences as a sequence of bytes represented
136+ * as C-style hex escapes;
137+ *
138+ * and return a pointer to it.
139+ *
140+ * @param allocator The wmem scope
141+ * @param string A pointer to the input string
142+ * @return A pointer to the formatted string
143+ *
144+ * @see tvb_format_text()
145+ */
146+WS_DLL_PUBLIC
147+gchar* format_text_string(wmem_allocator_t* allocator, const guchar *string);
148
149 /**
150 * Given a string, generate a string from it that shows non-printable
151--
1522.25.1
153
diff --git a/meta-networking/recipes-support/wireshark/files/CVE-2023-0667.patch b/meta-networking/recipes-support/wireshark/files/CVE-2023-0667.patch
new file mode 100644
index 0000000000..3fc5296073
--- /dev/null
+++ b/meta-networking/recipes-support/wireshark/files/CVE-2023-0667.patch
@@ -0,0 +1,66 @@
1From 85fbca8adb09ea8e1af635db3d92727fbfa1e28a Mon Sep 17 00:00:00 2001
2From: John Thacker <johnthacker@gmail.com>
3Date: Thu, 18 May 2023 18:06:36 -0400
4Subject: [PATCH] MS-MMS: Use format_text_string()
5
6The length of a string transcoded from UTF-16 to UTF-8 can be
7shorter (or longer) than the original length in bytes in the packet.
8Use the new string length, not the original length.
9
10Use format_text_string, which is a convenience function that
11calls strlen.
12
13Fix #19086
14
15(cherry picked from commit 1c45a899f83fa88e60ab69936bea3c4754e7808b)
16
17Upstream-Status: Backport [https://gitlab.com/wireshark/wireshark/-/commit/85fbca8adb09ea8e1af635db3d92727fbfa1e28a]
18CVE: CVE-2023-0667
19Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
20---
21 epan/dissectors/packet-ms-mms.c | 8 ++++----
22 1 file changed, 4 insertions(+), 4 deletions(-)
23
24diff --git a/epan/dissectors/packet-ms-mms.c b/epan/dissectors/packet-ms-mms.c
25index db1d2cc..3d5c7ee 100644
26--- a/epan/dissectors/packet-ms-mms.c
27+++ b/epan/dissectors/packet-ms-mms.c
28@@ -739,7 +739,7 @@ static void dissect_client_transport_info(tvbuff_t *tvb, packet_info *pinfo, pro
29 transport_info, "Transport: (%s)", transport_info);
30
31 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
32- format_text(wmem_packet_scope(), (guchar*)transport_info, length_remaining - 20));
33+ format_text_string(pinfo->pool, (const guchar*)transport_info));
34
35
36 /* Try to extract details from this string */
37@@ -836,7 +836,7 @@ static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
38 ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &server_version);
39
40 col_append_fstr(pinfo->cinfo, COL_INFO, " (version='%s')",
41- format_text(wmem_packet_scope(), (const guchar*)server_version, strlen(server_version)));
42+ format_text_string(pinfo->pool, (const guchar*)server_version));
43 }
44 offset += (server_version_length*2);
45
46@@ -890,7 +890,7 @@ static void dissect_client_player_info(tvbuff_t *tvb, packet_info *pinfo, proto_
47 ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &player_info);
48
49 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
50- format_text(wmem_packet_scope(), (const guchar*)player_info, strlen(player_info)));
51+ format_text_string(pinfo->pool, (const guchar*)player_info));
52 }
53
54 /* Dissect info about where client wants to start playing from */
55@@ -965,7 +965,7 @@ static void dissect_request_server_file(tvbuff_t *tvb, packet_info *pinfo, proto
56 ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &server_file);
57
58 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
59- format_text(wmem_packet_scope(), (const guchar*)server_file, strlen(server_file)));
60+ format_text_string(pinfo->pool, (const guchar*)server_file));
61 }
62
63 /* Dissect media details from server */
64--
652.25.1
66
diff --git a/meta-networking/recipes-support/wireshark/files/CVE-2023-0668.patch b/meta-networking/recipes-support/wireshark/files/CVE-2023-0668.patch
new file mode 100644
index 0000000000..42f8108301
--- /dev/null
+++ b/meta-networking/recipes-support/wireshark/files/CVE-2023-0668.patch
@@ -0,0 +1,33 @@
1From c4f37d77b29ec6a9754795d0efb6f68d633728d9 Mon Sep 17 00:00:00 2001
2From: John Thacker <johnthacker@gmail.com>
3Date: Sat, 20 May 2023 23:08:08 -0400
4Subject: [PATCH] synphasor: Use val_to_str_const
5
6Don't use a value from packet data to directly index a value_string,
7particularly when the value string doesn't cover all possible values.
8
9Fix #19087
10
11Upstream-Status: Backport [https://gitlab.com/wireshark/wireshark/-/commit/c4f37d77b29ec6a9754795d0efb6f68d633728d9]
12CVE: CVE-2023-0668
13Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
14---
15 epan/dissectors/packet-synphasor.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c
19index 2d2f4ad..47120f5 100644
20--- a/epan/dissectors/packet-synphasor.c
21+++ b/epan/dissectors/packet-synphasor.c
22@@ -1130,7 +1130,7 @@ static gint dissect_PHSCALE(tvbuff_t *tvb, proto_tree *tree, gint offset, gint c
23
24 data_flag_tree = proto_tree_add_subtree_format(single_phasor_scaling_and_flags_tree, tvb, offset, 4,
25 ett_conf_phflags, NULL, "Phasor Data flags: %s",
26- conf_phasor_type[tvb_get_guint8(tvb, offset + 2)].strptr);
27+ val_to_str_const(tvb_get_guint8(tvb, offset + 2), conf_phasor_type, "Unknown"));
28
29 /* first and second bytes - phasor modification flags*/
30 phasor_flag1_tree = proto_tree_add_subtree_format(data_flag_tree, tvb, offset, 2, ett_conf_phmod_flags,
31--
322.25.1
33
diff --git a/meta-networking/recipes-support/wireshark/wireshark_3.2.18.bb b/meta-networking/recipes-support/wireshark/wireshark_3.2.18.bb
index f80f287ab4..361123d1c5 100644
--- a/meta-networking/recipes-support/wireshark/wireshark_3.2.18.bb
+++ b/meta-networking/recipes-support/wireshark/wireshark_3.2.18.bb
@@ -14,6 +14,9 @@ SRC_URI = "https://1.eu.dl.wireshark.org/src/all-versions/wireshark-${PV}.tar.xz
14 file://CVE-2023-2856.patch \ 14 file://CVE-2023-2856.patch \
15 file://CVE-2023-2858.patch \ 15 file://CVE-2023-2858.patch \
16 file://CVE-2023-2952.patch \ 16 file://CVE-2023-2952.patch \
17 file://CVE-2023-0667-pre1.patch \
18 file://CVE-2023-0667.patch \
19 file://CVE-2023-0668.patch \
17 " 20 "
18UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src" 21UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src"
19 22