summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2024-09-29 14:58:35 +0200
committerArmin Kuster <akuster808@gmail.com>2024-10-06 07:27:47 -0400
commit6c9e6612f233a33f2ae4fd7427701375ba1a7113 (patch)
treeadf6ee3ec6388086f203d54ac1f6b62e3c2bb414
parentb2dc7d2aae9796edce300540b944774399df6ac3 (diff)
downloadmeta-openembedded-6c9e6612f233a33f2ae4fd7427701375ba1a7113.tar.gz
hostapd: Patch security advisory 2024-2
Pick patches according to http://w1.fi/security/2024-2/sae-h2h-and-incomplete-downgrade-protection-for-group-negotiation.txt SAE H2E and incomplete downgrade protection for group negotiation Patch 0002-SAE-Check-for-invalid-Rejected-Groups-element-length.patch was removed as it only patched wpa_supplicant. The patch names were not changed so it is comparable with wpa_supplicant recipe. Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd/0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch52
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd/0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch38
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb2
3 files changed, 92 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd/0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch b/meta-oe/recipes-connectivity/hostapd/hostapd/0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch
new file mode 100644
index 0000000000..5780f27f8b
--- /dev/null
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd/0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch
@@ -0,0 +1,52 @@
1From 364c2da8741f0979dae497551e70b94c0e6c8636 Mon Sep 17 00:00:00 2001
2From: Jouni Malinen <j@w1.fi>
3Date: Sun, 7 Jul 2024 11:46:49 +0300
4Subject: [PATCH 1/3] SAE: Check for invalid Rejected Groups element length
5 explicitly
6
7Instead of practically ignoring an odd octet at the end of the element,
8check for such invalid case explicitly. This is needed to avoid a
9potential group downgrade attack.
10
11Signed-off-by: Jouni Malinen <j@w1.fi>
12
13CVE: CVE-2024-3596
14Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=364c2da8741f0979dae497551e70b94c0e6c8636]
15Signed-off-by: Peter Marko <peter.marko@siemens.com>
16---
17 src/ap/ieee802_11.c | 12 ++++++++++--
18 1 file changed, 10 insertions(+), 2 deletions(-)
19
20diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
21index db4104928..1a62e30cc 100644
22--- a/src/ap/ieee802_11.c
23+++ b/src/ap/ieee802_11.c
24@@ -1258,7 +1258,7 @@ static int check_sae_rejected_groups(struct hostapd_data *hapd,
25 struct sae_data *sae)
26 {
27 const struct wpabuf *groups;
28- size_t i, count;
29+ size_t i, count, len;
30 const u8 *pos;
31
32 if (!sae->tmp)
33@@ -1268,7 +1268,15 @@ static int check_sae_rejected_groups(struct hostapd_data *hapd,
34 return 0;
35
36 pos = wpabuf_head(groups);
37- count = wpabuf_len(groups) / 2;
38+ len = wpabuf_len(groups);
39+ if (len & 1) {
40+ wpa_printf(MSG_DEBUG,
41+ "SAE: Invalid length of the Rejected Groups element payload: %zu",
42+ len);
43+ return 1;
44+ }
45+
46+ count = len / 2;
47 for (i = 0; i < count; i++) {
48 int enabled;
49 u16 group;
50--
512.30.2
52
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd/0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch b/meta-oe/recipes-connectivity/hostapd/hostapd/0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch
new file mode 100644
index 0000000000..5e9e8bc01d
--- /dev/null
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd/0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch
@@ -0,0 +1,38 @@
1From 9716bf1160beb677e965d9e6475d6c9e162e8374 Mon Sep 17 00:00:00 2001
2From: Jouni Malinen <j@w1.fi>
3Date: Tue, 9 Jul 2024 23:34:34 +0300
4Subject: [PATCH 3/3] SAE: Reject invalid Rejected Groups element in the parser
5
6There is no need to depend on all uses (i.e., both hostapd and
7wpa_supplicant) to verify that the length of the Rejected Groups field
8in the Rejected Groups element is valid (i.e., a multiple of two octets)
9since the common parser can reject the message when detecting this.
10
11Signed-off-by: Jouni Malinen <j@w1.fi>
12
13Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=9716bf1160beb677e965d9e6475d6c9e162e8374]
14Signed-off-by: Peter Marko <peter.marko@siemens.com>
15---
16 src/common/sae.c | 6 ++++++
17 1 file changed, 6 insertions(+)
18
19diff --git a/src/common/sae.c b/src/common/sae.c
20index c0f154e91..620bdf753 100644
21--- a/src/common/sae.c
22+++ b/src/common/sae.c
23@@ -2076,6 +2076,12 @@ static int sae_parse_rejected_groups(struct sae_data *sae,
24 return WLAN_STATUS_UNSPECIFIED_FAILURE;
25 epos++; /* skip ext ID */
26 len--;
27+ if (len & 1) {
28+ wpa_printf(MSG_DEBUG,
29+ "SAE: Invalid length of the Rejected Groups element payload: %u",
30+ len);
31+ return WLAN_STATUS_UNSPECIFIED_FAILURE;
32+ }
33
34 wpabuf_free(sae->tmp->peer_rejected_groups);
35 sae->tmp->peer_rejected_groups = wpabuf_alloc(len);
36--
372.30.2
38
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb b/meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb
index 70fac06d89..a745e7a404 100644
--- a/meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb
@@ -19,6 +19,8 @@ SRC_URI = " \
19 file://CVE-2024-3596_06.patch \ 19 file://CVE-2024-3596_06.patch \
20 file://CVE-2024-3596_07.patch \ 20 file://CVE-2024-3596_07.patch \
21 file://CVE-2024-3596_08.patch \ 21 file://CVE-2024-3596_08.patch \
22 file://0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch \
23 file://0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch \
22" 24"
23 25
24 26