diff options
9 files changed, 6 insertions, 638 deletions
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-AP-Silently-ignore-management-frame-from-unexpected-.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-AP-Silently-ignore-management-frame-from-unexpected-.patch deleted file mode 100644 index 7b0713cf6d..0000000000 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-AP-Silently-ignore-management-frame-from-unexpected-.patch +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | hostapd before 2.10 and wpa_supplicant before 2.10 allow an incorrect indication | ||
2 | of disconnection in certain situations because source address validation is | ||
3 | mishandled. This is a denial of service that should have been prevented by PMF | ||
4 | (aka management frame protection). The attacker must send a crafted 802.11 frame | ||
5 | from a location that is within the 802.11 communications range. | ||
6 | |||
7 | CVE: CVE-2019-16275 | ||
8 | Upstream-Status: Backport | ||
9 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
10 | |||
11 | From 8c07fa9eda13e835f3f968b2e1c9a8be3a851ff9 Mon Sep 17 00:00:00 2001 | ||
12 | From: Jouni Malinen <j@w1.fi> | ||
13 | Date: Thu, 29 Aug 2019 11:52:04 +0300 | ||
14 | Subject: [PATCH] AP: Silently ignore management frame from unexpected source | ||
15 | address | ||
16 | |||
17 | Do not process any received Management frames with unexpected/invalid SA | ||
18 | so that we do not add any state for unexpected STA addresses or end up | ||
19 | sending out frames to unexpected destination. This prevents unexpected | ||
20 | sequences where an unprotected frame might end up causing the AP to send | ||
21 | out a response to another device and that other device processing the | ||
22 | unexpected response. | ||
23 | |||
24 | In particular, this prevents some potential denial of service cases | ||
25 | where the unexpected response frame from the AP might result in a | ||
26 | connected station dropping its association. | ||
27 | |||
28 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
29 | --- | ||
30 | src/ap/drv_callbacks.c | 13 +++++++++++++ | ||
31 | src/ap/ieee802_11.c | 12 ++++++++++++ | ||
32 | 2 files changed, 25 insertions(+) | ||
33 | |||
34 | diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c | ||
35 | index 31587685fe3b..34ca379edc3d 100644 | ||
36 | --- a/src/ap/drv_callbacks.c | ||
37 | +++ b/src/ap/drv_callbacks.c | ||
38 | @@ -131,6 +131,19 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, | ||
39 | "hostapd_notif_assoc: Skip event with no address"); | ||
40 | return -1; | ||
41 | } | ||
42 | + | ||
43 | + if (is_multicast_ether_addr(addr) || | ||
44 | + is_zero_ether_addr(addr) || | ||
45 | + os_memcmp(addr, hapd->own_addr, ETH_ALEN) == 0) { | ||
46 | + /* Do not process any frames with unexpected/invalid SA so that | ||
47 | + * we do not add any state for unexpected STA addresses or end | ||
48 | + * up sending out frames to unexpected destination. */ | ||
49 | + wpa_printf(MSG_DEBUG, "%s: Invalid SA=" MACSTR | ||
50 | + " in received indication - ignore this indication silently", | ||
51 | + __func__, MAC2STR(addr)); | ||
52 | + return 0; | ||
53 | + } | ||
54 | + | ||
55 | random_add_randomness(addr, ETH_ALEN); | ||
56 | |||
57 | hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211, | ||
58 | diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c | ||
59 | index c85a28db44b7..e7065372e158 100644 | ||
60 | --- a/src/ap/ieee802_11.c | ||
61 | +++ b/src/ap/ieee802_11.c | ||
62 | @@ -4626,6 +4626,18 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, | ||
63 | fc = le_to_host16(mgmt->frame_control); | ||
64 | stype = WLAN_FC_GET_STYPE(fc); | ||
65 | |||
66 | + if (is_multicast_ether_addr(mgmt->sa) || | ||
67 | + is_zero_ether_addr(mgmt->sa) || | ||
68 | + os_memcmp(mgmt->sa, hapd->own_addr, ETH_ALEN) == 0) { | ||
69 | + /* Do not process any frames with unexpected/invalid SA so that | ||
70 | + * we do not add any state for unexpected STA addresses or end | ||
71 | + * up sending out frames to unexpected destination. */ | ||
72 | + wpa_printf(MSG_DEBUG, "MGMT: Invalid SA=" MACSTR | ||
73 | + " in received frame - ignore this frame silently", | ||
74 | + MAC2STR(mgmt->sa)); | ||
75 | + return 0; | ||
76 | + } | ||
77 | + | ||
78 | if (stype == WLAN_FC_STYPE_BEACON) { | ||
79 | handle_beacon(hapd, mgmt, len, fi); | ||
80 | return 1; | ||
81 | -- | ||
82 | 2.20.1 | ||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch deleted file mode 100644 index 53ad5d028a..0000000000 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | From 5b78c8f961f25f4dc22d6f2b77ddd06d712cec63 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jouni Malinen <jouni@codeaurora.org> | ||
3 | Date: Wed, 3 Jun 2020 23:17:35 +0300 | ||
4 | Subject: [PATCH 1/3] WPS UPnP: Do not allow event subscriptions with URLs to | ||
5 | other networks | ||
6 | |||
7 | The UPnP Device Architecture 2.0 specification errata ("UDA errata | ||
8 | 16-04-2020.docx") addresses a problem with notifications being allowed | ||
9 | to go out to other domains by disallowing such cases. Do such filtering | ||
10 | for the notification callback URLs to avoid undesired connections to | ||
11 | external networks based on subscriptions that any device in the local | ||
12 | network could request when WPS support for external registrars is | ||
13 | enabled (the upnp_iface parameter in hostapd configuration). | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | CVE: CVE-2020-12695 patch #1 | ||
17 | Signed-off-by: Jouni Malinen <jouni@codeaurora.org> | ||
18 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
19 | |||
20 | --- | ||
21 | src/wps/wps_er.c | 2 +- | ||
22 | src/wps/wps_upnp.c | 38 ++++++++++++++++++++++++++++++++++++-- | ||
23 | src/wps/wps_upnp_i.h | 3 ++- | ||
24 | 3 files changed, 39 insertions(+), 4 deletions(-) | ||
25 | |||
26 | Index: wpa_supplicant-2.9/src/wps/wps_er.c | ||
27 | =================================================================== | ||
28 | --- wpa_supplicant-2.9.orig/src/wps/wps_er.c | ||
29 | +++ wpa_supplicant-2.9/src/wps/wps_er.c | ||
30 | @@ -1298,7 +1298,7 @@ wps_er_init(struct wps_context *wps, con | ||
31 | "with %s", filter); | ||
32 | } | ||
33 | if (get_netif_info(er->ifname, &er->ip_addr, &er->ip_addr_text, | ||
34 | - er->mac_addr)) { | ||
35 | + NULL, er->mac_addr)) { | ||
36 | wpa_printf(MSG_INFO, "WPS UPnP: Could not get IP/MAC address " | ||
37 | "for %s. Does it have IP address?", er->ifname); | ||
38 | wps_er_deinit(er, NULL, NULL); | ||
39 | Index: wpa_supplicant-2.9/src/wps/wps_upnp.c | ||
40 | =================================================================== | ||
41 | --- wpa_supplicant-2.9.orig/src/wps/wps_upnp.c | ||
42 | +++ wpa_supplicant-2.9/src/wps/wps_upnp.c | ||
43 | @@ -303,6 +303,14 @@ static void subscr_addr_free_all(struct | ||
44 | } | ||
45 | |||
46 | |||
47 | +static int local_network_addr(struct upnp_wps_device_sm *sm, | ||
48 | + struct sockaddr_in *addr) | ||
49 | +{ | ||
50 | + return (addr->sin_addr.s_addr & sm->netmask.s_addr) == | ||
51 | + (sm->ip_addr & sm->netmask.s_addr); | ||
52 | +} | ||
53 | + | ||
54 | + | ||
55 | /* subscr_addr_add_url -- add address(es) for one url to subscription */ | ||
56 | static void subscr_addr_add_url(struct subscription *s, const char *url, | ||
57 | size_t url_len) | ||
58 | @@ -381,6 +389,7 @@ static void subscr_addr_add_url(struct s | ||
59 | |||
60 | for (rp = result; rp; rp = rp->ai_next) { | ||
61 | struct subscr_addr *a; | ||
62 | + struct sockaddr_in *addr = (struct sockaddr_in *) rp->ai_addr; | ||
63 | |||
64 | /* Limit no. of address to avoid denial of service attack */ | ||
65 | if (dl_list_len(&s->addr_list) >= MAX_ADDR_PER_SUBSCRIPTION) { | ||
66 | @@ -389,6 +398,13 @@ static void subscr_addr_add_url(struct s | ||
67 | break; | ||
68 | } | ||
69 | |||
70 | + if (!local_network_addr(s->sm, addr)) { | ||
71 | + wpa_printf(MSG_INFO, | ||
72 | + "WPS UPnP: Ignore a delivery URL that points to another network %s", | ||
73 | + inet_ntoa(addr->sin_addr)); | ||
74 | + continue; | ||
75 | + } | ||
76 | + | ||
77 | a = os_zalloc(sizeof(*a) + alloc_len); | ||
78 | if (a == NULL) | ||
79 | break; | ||
80 | @@ -889,11 +905,12 @@ static int eth_get(const char *device, u | ||
81 | * @net_if: Selected network interface name | ||
82 | * @ip_addr: Buffer for returning IP address in network byte order | ||
83 | * @ip_addr_text: Buffer for returning a pointer to allocated IP address text | ||
84 | + * @netmask: Buffer for returning netmask or %NULL if not needed | ||
85 | * @mac: Buffer for returning MAC address | ||
86 | * Returns: 0 on success, -1 on failure | ||
87 | */ | ||
88 | int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text, | ||
89 | - u8 mac[ETH_ALEN]) | ||
90 | + struct in_addr *netmask, u8 mac[ETH_ALEN]) | ||
91 | { | ||
92 | struct ifreq req; | ||
93 | int sock = -1; | ||
94 | @@ -919,6 +936,19 @@ int get_netif_info(const char *net_if, u | ||
95 | in_addr.s_addr = *ip_addr; | ||
96 | os_snprintf(*ip_addr_text, 16, "%s", inet_ntoa(in_addr)); | ||
97 | |||
98 | + if (netmask) { | ||
99 | + os_memset(&req, 0, sizeof(req)); | ||
100 | + os_strlcpy(req.ifr_name, net_if, sizeof(req.ifr_name)); | ||
101 | + if (ioctl(sock, SIOCGIFNETMASK, &req) < 0) { | ||
102 | + wpa_printf(MSG_ERROR, | ||
103 | + "WPS UPnP: SIOCGIFNETMASK failed: %d (%s)", | ||
104 | + errno, strerror(errno)); | ||
105 | + goto fail; | ||
106 | + } | ||
107 | + addr = (struct sockaddr_in *) &req.ifr_netmask; | ||
108 | + netmask->s_addr = addr->sin_addr.s_addr; | ||
109 | + } | ||
110 | + | ||
111 | #ifdef __linux__ | ||
112 | os_strlcpy(req.ifr_name, net_if, sizeof(req.ifr_name)); | ||
113 | if (ioctl(sock, SIOCGIFHWADDR, &req) < 0) { | ||
114 | @@ -1025,11 +1055,15 @@ static int upnp_wps_device_start(struct | ||
115 | |||
116 | /* Determine which IP and mac address we're using */ | ||
117 | if (get_netif_info(net_if, &sm->ip_addr, &sm->ip_addr_text, | ||
118 | - sm->mac_addr)) { | ||
119 | + &sm->netmask, sm->mac_addr)) { | ||
120 | wpa_printf(MSG_INFO, "WPS UPnP: Could not get IP/MAC address " | ||
121 | "for %s. Does it have IP address?", net_if); | ||
122 | goto fail; | ||
123 | } | ||
124 | + wpa_printf(MSG_DEBUG, "WPS UPnP: Local IP address %s netmask %s hwaddr " | ||
125 | + MACSTR, | ||
126 | + sm->ip_addr_text, inet_ntoa(sm->netmask), | ||
127 | + MAC2STR(sm->mac_addr)); | ||
128 | |||
129 | /* Listen for incoming TCP connections so that others | ||
130 | * can fetch our "xml files" from us. | ||
131 | Index: wpa_supplicant-2.9/src/wps/wps_upnp_i.h | ||
132 | =================================================================== | ||
133 | --- wpa_supplicant-2.9.orig/src/wps/wps_upnp_i.h | ||
134 | +++ wpa_supplicant-2.9/src/wps/wps_upnp_i.h | ||
135 | @@ -128,6 +128,7 @@ struct upnp_wps_device_sm { | ||
136 | u8 mac_addr[ETH_ALEN]; /* mac addr of network i.f. we use */ | ||
137 | char *ip_addr_text; /* IP address of network i.f. we use */ | ||
138 | unsigned ip_addr; /* IP address of network i.f. we use (host order) */ | ||
139 | + struct in_addr netmask; | ||
140 | int multicast_sd; /* send multicast messages over this socket */ | ||
141 | int ssdp_sd; /* receive discovery UPD packets on socket */ | ||
142 | int ssdp_sd_registered; /* nonzero if we must unregister */ | ||
143 | @@ -158,7 +159,7 @@ struct subscription * subscription_find( | ||
144 | const u8 uuid[UUID_LEN]); | ||
145 | void subscr_addr_delete(struct subscr_addr *a); | ||
146 | int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text, | ||
147 | - u8 mac[ETH_ALEN]); | ||
148 | + struct in_addr *netmask, u8 mac[ETH_ALEN]); | ||
149 | |||
150 | /* wps_upnp_ssdp.c */ | ||
151 | void msearchreply_state_machine_stop(struct advertisement_state_machine *a); | ||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-replace-systemd-install-Alias-with-WantedBy.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-replace-systemd-install-Alias-with-WantedBy.patch deleted file mode 100644 index a476cf040e..0000000000 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-replace-systemd-install-Alias-with-WantedBy.patch +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | From 94c401733a5a3d294cc412671166e6adfb409f53 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joshua DeWeese <jdeweese@hennypenny.com> | ||
3 | Date: Wed, 30 Jan 2019 16:19:47 -0500 | ||
4 | Subject: [PATCH] replace systemd install Alias with WantedBy | ||
5 | |||
6 | According to the systemd documentation "WantedBy=foo.service in a | ||
7 | service bar.service is mostly equivalent to | ||
8 | Alias=foo.service.wants/bar.service in the same file." However, | ||
9 | this is not really the intended purpose of install Aliases. | ||
10 | |||
11 | Upstream-Status: Submitted [hostap@lists.infradead.org] | ||
12 | |||
13 | Signed-off-by: Joshua DeWeese <jdeweese@hennypenny.com> | ||
14 | --- | ||
15 | wpa_supplicant/systemd/wpa_supplicant-nl80211.service.arg.in | 2 +- | ||
16 | wpa_supplicant/systemd/wpa_supplicant-wired.service.arg.in | 2 +- | ||
17 | wpa_supplicant/systemd/wpa_supplicant.service.arg.in | 2 +- | ||
18 | 3 files changed, 3 insertions(+), 3 deletions(-) | ||
19 | |||
20 | diff --git a/wpa_supplicant/systemd/wpa_supplicant-nl80211.service.arg.in b/wpa_supplicant/systemd/wpa_supplicant-nl80211.service.arg.in | ||
21 | index 03ac507..da69a87 100644 | ||
22 | --- a/wpa_supplicant/systemd/wpa_supplicant-nl80211.service.arg.in | ||
23 | +++ b/wpa_supplicant/systemd/wpa_supplicant-nl80211.service.arg.in | ||
24 | @@ -12,4 +12,4 @@ Type=simple | ||
25 | ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-nl80211-%I.conf -Dnl80211 -i%I | ||
26 | |||
27 | [Install] | ||
28 | -Alias=multi-user.target.wants/wpa_supplicant-nl80211@%i.service | ||
29 | +WantedBy=multi-user.target | ||
30 | diff --git a/wpa_supplicant/systemd/wpa_supplicant-wired.service.arg.in b/wpa_supplicant/systemd/wpa_supplicant-wired.service.arg.in | ||
31 | index c8a744d..ca3054b 100644 | ||
32 | --- a/wpa_supplicant/systemd/wpa_supplicant-wired.service.arg.in | ||
33 | +++ b/wpa_supplicant/systemd/wpa_supplicant-wired.service.arg.in | ||
34 | @@ -12,4 +12,4 @@ Type=simple | ||
35 | ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wired-%I.conf -Dwired -i%I | ||
36 | |||
37 | [Install] | ||
38 | -Alias=multi-user.target.wants/wpa_supplicant-wired@%i.service | ||
39 | +WantedBy=multi-user.target | ||
40 | diff --git a/wpa_supplicant/systemd/wpa_supplicant.service.arg.in b/wpa_supplicant/systemd/wpa_supplicant.service.arg.in | ||
41 | index 7788b38..55d2b9c 100644 | ||
42 | --- a/wpa_supplicant/systemd/wpa_supplicant.service.arg.in | ||
43 | +++ b/wpa_supplicant/systemd/wpa_supplicant.service.arg.in | ||
44 | @@ -12,4 +12,4 @@ Type=simple | ||
45 | ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I | ||
46 | |||
47 | [Install] | ||
48 | -Alias=multi-user.target.wants/wpa_supplicant@%i.service | ||
49 | +WantedBy=multi-user.target | ||
50 | -- | ||
51 | 2.7.4 | ||
52 | |||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch deleted file mode 100644 index 59640859dd..0000000000 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | From f7d268864a2660b7239b9a8ff5ad37faeeb751ba Mon Sep 17 00:00:00 2001 | ||
2 | From: Jouni Malinen <jouni@codeaurora.org> | ||
3 | Date: Wed, 3 Jun 2020 22:41:02 +0300 | ||
4 | Subject: [PATCH 2/3] WPS UPnP: Fix event message generation using a long URL | ||
5 | path | ||
6 | |||
7 | More than about 700 character URL ended up overflowing the wpabuf used | ||
8 | for building the event notification and this resulted in the wpabuf | ||
9 | buffer overflow checks terminating the hostapd process. Fix this by | ||
10 | allocating the buffer to be large enough to contain the full URL path. | ||
11 | However, since that around 700 character limit has been the practical | ||
12 | limit for more than ten years, start explicitly enforcing that as the | ||
13 | limit or the callback URLs since any longer ones had not worked before | ||
14 | and there is no need to enable them now either. | ||
15 | |||
16 | Upstream-Status: Backport | ||
17 | CVE: CVE-2020-12695 patch #2 | ||
18 | Signed-off-by: Jouni Malinen <jouni@codeaurora.org> | ||
19 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
20 | |||
21 | --- | ||
22 | src/wps/wps_upnp.c | 9 +++++++-- | ||
23 | src/wps/wps_upnp_event.c | 3 ++- | ||
24 | 2 files changed, 9 insertions(+), 3 deletions(-) | ||
25 | |||
26 | diff --git a/src/wps/wps_upnp.c b/src/wps/wps_upnp.c | ||
27 | index 7d4b7439940e..ab685d52ecab 100644 | ||
28 | --- a/src/wps/wps_upnp.c | ||
29 | +++ b/src/wps/wps_upnp.c | ||
30 | @@ -328,9 +328,14 @@ static void subscr_addr_add_url(struct subscription *s, const char *url, | ||
31 | int rerr; | ||
32 | size_t host_len, path_len; | ||
33 | |||
34 | - /* url MUST begin with http: */ | ||
35 | - if (url_len < 7 || os_strncasecmp(url, "http://", 7)) | ||
36 | + /* URL MUST begin with HTTP scheme. In addition, limit the length of | ||
37 | + * the URL to 700 characters which is around the limit that was | ||
38 | + * implicitly enforced for more than 10 years due to a bug in | ||
39 | + * generating the event messages. */ | ||
40 | + if (url_len < 7 || os_strncasecmp(url, "http://", 7) || url_len > 700) { | ||
41 | + wpa_printf(MSG_DEBUG, "WPS UPnP: Reject an unacceptable URL"); | ||
42 | goto fail; | ||
43 | + } | ||
44 | url += 7; | ||
45 | url_len -= 7; | ||
46 | |||
47 | diff --git a/src/wps/wps_upnp_event.c b/src/wps/wps_upnp_event.c | ||
48 | index d7e6edcc6503..08a23612f338 100644 | ||
49 | --- a/src/wps/wps_upnp_event.c | ||
50 | +++ b/src/wps/wps_upnp_event.c | ||
51 | @@ -147,7 +147,8 @@ static struct wpabuf * event_build_message(struct wps_event_ *e) | ||
52 | struct wpabuf *buf; | ||
53 | char *b; | ||
54 | |||
55 | - buf = wpabuf_alloc(1000 + wpabuf_len(e->data)); | ||
56 | + buf = wpabuf_alloc(1000 + os_strlen(e->addr->path) + | ||
57 | + wpabuf_len(e->data)); | ||
58 | if (buf == NULL) | ||
59 | return NULL; | ||
60 | wpabuf_printf(buf, "NOTIFY %s HTTP/1.1\r\n", e->addr->path); | ||
61 | -- | ||
62 | 2.20.1 | ||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch deleted file mode 100644 index 8a014ef28a..0000000000 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | From 85aac526af8612c21b3117dadc8ef5944985b476 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jouni Malinen <jouni@codeaurora.org> | ||
3 | Date: Thu, 4 Jun 2020 21:24:04 +0300 | ||
4 | Subject: [PATCH 3/3] WPS UPnP: Handle HTTP initiation failures for events more | ||
5 | properly | ||
6 | |||
7 | While it is appropriate to try to retransmit the event to another | ||
8 | callback URL on a failure to initiate the HTTP client connection, there | ||
9 | is no point in trying the exact same operation multiple times in a row. | ||
10 | Replve the event_retry() calls with event_addr_failure() for these cases | ||
11 | to avoid busy loops trying to repeat the same failing operation. | ||
12 | |||
13 | These potential busy loops would go through eloop callbacks, so the | ||
14 | process is not completely stuck on handling them, but unnecessary CPU | ||
15 | would be used to process the continues retries that will keep failing | ||
16 | for the same reason. | ||
17 | |||
18 | Upstream-Status: Backport | ||
19 | CVE: CVE-2020-12695 patch #2 | ||
20 | Signed-off-by: Jouni Malinen <jouni@codeaurora.org> | ||
21 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
22 | |||
23 | --- | ||
24 | src/wps/wps_upnp_event.c | 4 ++-- | ||
25 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
26 | |||
27 | diff --git a/src/wps/wps_upnp_event.c b/src/wps/wps_upnp_event.c | ||
28 | index 08a23612f338..c0d9e41d9a38 100644 | ||
29 | --- a/src/wps/wps_upnp_event.c | ||
30 | +++ b/src/wps/wps_upnp_event.c | ||
31 | @@ -294,7 +294,7 @@ static int event_send_start(struct subscription *s) | ||
32 | |||
33 | buf = event_build_message(e); | ||
34 | if (buf == NULL) { | ||
35 | - event_retry(e, 0); | ||
36 | + event_addr_failure(e); | ||
37 | return -1; | ||
38 | } | ||
39 | |||
40 | @@ -302,7 +302,7 @@ static int event_send_start(struct subscription *s) | ||
41 | event_http_cb, e); | ||
42 | if (e->http_event == NULL) { | ||
43 | wpabuf_free(buf); | ||
44 | - event_retry(e, 0); | ||
45 | + event_addr_failure(e); | ||
46 | return -1; | ||
47 | } | ||
48 | |||
49 | -- | ||
50 | 2.20.1 | ||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-0326.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-0326.patch deleted file mode 100644 index 8c90fa3421..0000000000 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-0326.patch +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | From 947272febe24a8f0ea828b5b2f35f13c3821901e Mon Sep 17 00:00:00 2001 | ||
2 | From: Jouni Malinen <jouni@codeaurora.org> | ||
3 | Date: Mon, 9 Nov 2020 11:43:12 +0200 | ||
4 | Subject: [PATCH] P2P: Fix copying of secondary device types for P2P group | ||
5 | client | ||
6 | |||
7 | Parsing and copying of WPS secondary device types list was verifying | ||
8 | that the contents is not too long for the internal maximum in the case | ||
9 | of WPS messages, but similar validation was missing from the case of P2P | ||
10 | group information which encodes this information in a different | ||
11 | attribute. This could result in writing beyond the memory area assigned | ||
12 | for these entries and corrupting memory within an instance of struct | ||
13 | p2p_device. This could result in invalid operations and unexpected | ||
14 | behavior when trying to free pointers from that corrupted memory. | ||
15 | |||
16 | Upstream-Status: Backport | ||
17 | CVE: CVE-2021-0326 | ||
18 | |||
19 | Reference to upstream patch: | ||
20 | [https://w1.fi/cgit/hostap/commit/?id=947272febe24a8f0ea828b5b2f35f13c3821901e] | ||
21 | |||
22 | Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27269 | ||
23 | Fixes: e57ae6e19edf ("P2P: Keep track of secondary device types for peers") | ||
24 | Signed-off-by: Jouni Malinen <jouni@codeaurora.org> | ||
25 | Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com> | ||
26 | --- | ||
27 | src/p2p/p2p.c | 2 ++ | ||
28 | 1 file changed, 2 insertions(+) | ||
29 | |||
30 | diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c | ||
31 | index a08ba02..079270f 100644 | ||
32 | --- a/src/p2p/p2p.c | ||
33 | +++ b/src/p2p/p2p.c | ||
34 | @@ -453,6 +453,8 @@ static void p2p_copy_client_info(struct p2p_device *dev, | ||
35 | dev->info.config_methods = cli->config_methods; | ||
36 | os_memcpy(dev->info.pri_dev_type, cli->pri_dev_type, 8); | ||
37 | dev->info.wps_sec_dev_type_list_len = 8 * cli->num_sec_dev_types; | ||
38 | + if (dev->info.wps_sec_dev_type_list_len > WPS_SEC_DEV_TYPE_MAX_LEN) | ||
39 | + dev->info.wps_sec_dev_type_list_len = WPS_SEC_DEV_TYPE_MAX_LEN; | ||
40 | os_memcpy(dev->info.wps_sec_dev_type_list, cli->sec_dev_types, | ||
41 | dev->info.wps_sec_dev_type_list_len); | ||
42 | } | ||
43 | -- | ||
44 | 2.17.1 | ||
45 | |||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-27803.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-27803.patch deleted file mode 100644 index 004b1dbd19..0000000000 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-27803.patch +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | From 8460e3230988ef2ec13ce6b69b687e941f6cdb32 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jouni Malinen <jouni@codeaurora.org> | ||
3 | Date: Tue, 8 Dec 2020 23:52:50 +0200 | ||
4 | Subject: [PATCH] P2P: Fix a corner case in peer addition based on PD Request | ||
5 | |||
6 | p2p_add_device() may remove the oldest entry if there is no room in the | ||
7 | peer table for a new peer. This would result in any pointer to that | ||
8 | removed entry becoming stale. A corner case with an invalid PD Request | ||
9 | frame could result in such a case ending up using (read+write) freed | ||
10 | memory. This could only by triggered when the peer table has reached its | ||
11 | maximum size and the PD Request frame is received from the P2P Device | ||
12 | Address of the oldest remaining entry and the frame has incorrect P2P | ||
13 | Device Address in the payload. | ||
14 | |||
15 | Fix this by fetching the dev pointer again after having called | ||
16 | p2p_add_device() so that the stale pointer cannot be used. | ||
17 | |||
18 | Fixes: 17bef1e97a50 ("P2P: Add peer entry based on Provision Discovery Request") | ||
19 | Signed-off-by: Jouni Malinen <jouni@codeaurora.org> | ||
20 | |||
21 | Upstream-Status: Backport | ||
22 | CVE: CVE-2021-27803 | ||
23 | |||
24 | Reference to upstream patch: | ||
25 | [https://w1.fi/cgit/hostap/commit/?id=8460e3230988ef2ec13ce6b69b687e941f6cdb32] | ||
26 | |||
27 | Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com> | ||
28 | --- | ||
29 | src/p2p/p2p_pd.c | 12 +++++------- | ||
30 | 1 file changed, 5 insertions(+), 7 deletions(-) | ||
31 | |||
32 | diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c | ||
33 | index 3994ec0..05fd593 100644 | ||
34 | --- a/src/p2p/p2p_pd.c | ||
35 | +++ b/src/p2p/p2p_pd.c | ||
36 | @@ -595,14 +595,12 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa, | ||
37 | goto out; | ||
38 | } | ||
39 | |||
40 | + dev = p2p_get_device(p2p, sa); | ||
41 | if (!dev) { | ||
42 | - dev = p2p_get_device(p2p, sa); | ||
43 | - if (!dev) { | ||
44 | - p2p_dbg(p2p, | ||
45 | - "Provision Discovery device not found " | ||
46 | - MACSTR, MAC2STR(sa)); | ||
47 | - goto out; | ||
48 | - } | ||
49 | + p2p_dbg(p2p, | ||
50 | + "Provision Discovery device not found " | ||
51 | + MACSTR, MAC2STR(sa)); | ||
52 | + goto out; | ||
53 | } | ||
54 | } else if (msg.wfd_subelems) { | ||
55 | wpabuf_free(dev->info.wfd_subelems); | ||
56 | -- | ||
57 | 2.17.1 | ||
58 | |||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-30004.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-30004.patch deleted file mode 100644 index e2540fc26b..0000000000 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/CVE-2021-30004.patch +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | From a0541334a6394f8237a4393b7372693cd7e96f15 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jouni Malinen <j@w1.fi> | ||
3 | Date: Sat, 13 Mar 2021 18:19:31 +0200 | ||
4 | Subject: [PATCH] ASN.1: Validate DigestAlgorithmIdentifier parameters | ||
5 | |||
6 | The supported hash algorithms do not use AlgorithmIdentifier parameters. | ||
7 | However, there are implementations that include NULL parameters in | ||
8 | addition to ones that omit the parameters. Previous implementation did | ||
9 | not check the parameters value at all which supported both these cases, | ||
10 | but did not reject any other unexpected information. | ||
11 | |||
12 | Use strict validation of digest algorithm parameters and reject any | ||
13 | unexpected value when validating a signature. This is needed to prevent | ||
14 | potential forging attacks. | ||
15 | |||
16 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
17 | |||
18 | Upstream-Status: Backport | ||
19 | CVE: CVE-2021-30004 | ||
20 | |||
21 | Reference to upstream patch: | ||
22 | [https://w1.fi/cgit/hostap/commit/?id=a0541334a6394f8237a4393b7372693cd7e96f15] | ||
23 | |||
24 | Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com> | ||
25 | --- | ||
26 | src/tls/pkcs1.c | 21 +++++++++++++++++++++ | ||
27 | src/tls/x509v3.c | 20 ++++++++++++++++++++ | ||
28 | 2 files changed, 41 insertions(+) | ||
29 | |||
30 | diff --git a/src/tls/pkcs1.c b/src/tls/pkcs1.c | ||
31 | index 141ac50..e09db07 100644 | ||
32 | --- a/src/tls/pkcs1.c | ||
33 | +++ b/src/tls/pkcs1.c | ||
34 | @@ -240,6 +240,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk, | ||
35 | os_free(decrypted); | ||
36 | return -1; | ||
37 | } | ||
38 | + wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestInfo", | ||
39 | + hdr.payload, hdr.length); | ||
40 | |||
41 | pos = hdr.payload; | ||
42 | end = pos + hdr.length; | ||
43 | @@ -261,6 +263,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk, | ||
44 | os_free(decrypted); | ||
45 | return -1; | ||
46 | } | ||
47 | + wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestAlgorithmIdentifier", | ||
48 | + hdr.payload, hdr.length); | ||
49 | da_end = hdr.payload + hdr.length; | ||
50 | |||
51 | if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) { | ||
52 | @@ -269,6 +273,23 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk, | ||
53 | os_free(decrypted); | ||
54 | return -1; | ||
55 | } | ||
56 | + wpa_hexdump(MSG_MSGDUMP, "PKCS #1: Digest algorithm parameters", | ||
57 | + next, da_end - next); | ||
58 | + | ||
59 | + /* | ||
60 | + * RFC 5754: The correct encoding for the SHA2 algorithms would be to | ||
61 | + * omit the parameters, but there are implementation that encode these | ||
62 | + * as a NULL element. Allow these two cases and reject anything else. | ||
63 | + */ | ||
64 | + if (da_end > next && | ||
65 | + (asn1_get_next(next, da_end - next, &hdr) < 0 || | ||
66 | + !asn1_is_null(&hdr) || | ||
67 | + hdr.payload + hdr.length != da_end)) { | ||
68 | + wpa_printf(MSG_DEBUG, | ||
69 | + "PKCS #1: Unexpected digest algorithm parameters"); | ||
70 | + os_free(decrypted); | ||
71 | + return -1; | ||
72 | + } | ||
73 | |||
74 | if (!asn1_oid_equal(&oid, hash_alg)) { | ||
75 | char txt[100], txt2[100]; | ||
76 | diff --git a/src/tls/x509v3.c b/src/tls/x509v3.c | ||
77 | index 1bd5aa0..bf2289f 100644 | ||
78 | --- a/src/tls/x509v3.c | ||
79 | +++ b/src/tls/x509v3.c | ||
80 | @@ -1834,6 +1834,7 @@ int x509_check_signature(struct x509_certificate *issuer, | ||
81 | os_free(data); | ||
82 | return -1; | ||
83 | } | ||
84 | + wpa_hexdump(MSG_MSGDUMP, "X509: DigestInfo", hdr.payload, hdr.length); | ||
85 | |||
86 | pos = hdr.payload; | ||
87 | end = pos + hdr.length; | ||
88 | @@ -1855,6 +1856,8 @@ int x509_check_signature(struct x509_certificate *issuer, | ||
89 | os_free(data); | ||
90 | return -1; | ||
91 | } | ||
92 | + wpa_hexdump(MSG_MSGDUMP, "X509: DigestAlgorithmIdentifier", | ||
93 | + hdr.payload, hdr.length); | ||
94 | da_end = hdr.payload + hdr.length; | ||
95 | |||
96 | if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) { | ||
97 | @@ -1862,6 +1865,23 @@ int x509_check_signature(struct x509_certificate *issuer, | ||
98 | os_free(data); | ||
99 | return -1; | ||
100 | } | ||
101 | + wpa_hexdump(MSG_MSGDUMP, "X509: Digest algorithm parameters", | ||
102 | + next, da_end - next); | ||
103 | + | ||
104 | + /* | ||
105 | + * RFC 5754: The correct encoding for the SHA2 algorithms would be to | ||
106 | + * omit the parameters, but there are implementation that encode these | ||
107 | + * as a NULL element. Allow these two cases and reject anything else. | ||
108 | + */ | ||
109 | + if (da_end > next && | ||
110 | + (asn1_get_next(next, da_end - next, &hdr) < 0 || | ||
111 | + !asn1_is_null(&hdr) || | ||
112 | + hdr.payload + hdr.length != da_end)) { | ||
113 | + wpa_printf(MSG_DEBUG, | ||
114 | + "X509: Unexpected digest algorithm parameters"); | ||
115 | + os_free(data); | ||
116 | + return -1; | ||
117 | + } | ||
118 | |||
119 | if (x509_sha1_oid(&oid)) { | ||
120 | if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) { | ||
121 | -- | ||
122 | 2.17.1 | ||
123 | |||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.10.bb index 25cd8ef82c..6e80ac7de3 100644 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.9.bb +++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.10.bb | |||
@@ -4,9 +4,9 @@ DESCRIPTION = "wpa_supplicant is a WPA Supplicant for Linux, BSD, Mac OS X, and | |||
4 | BUGTRACKER = "http://w1.fi/security/" | 4 | BUGTRACKER = "http://w1.fi/security/" |
5 | SECTION = "network" | 5 | SECTION = "network" |
6 | LICENSE = "BSD-3-Clause" | 6 | LICENSE = "BSD-3-Clause" |
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=279b4f5abb9c153c285221855ddb78cc \ | 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=5ebcb90236d1ad640558c3d3cd3035df \ |
8 | file://README;beginline=1;endline=56;md5=e7d3dbb01f75f0b9799e192731d1e1ff \ | 8 | file://README;beginline=1;endline=56;md5=e3d2f6c2948991e37c1ca4960de84747 \ |
9 | file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=0a8b56d3543498b742b9c0e94cc2d18b" | 9 | file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=76306a95306fee9a976b0ac1be70f705" |
10 | DEPENDS = "dbus libnl" | 10 | DEPENDS = "dbus libnl" |
11 | RRECOMMENDS:${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli" | 11 | RRECOMMENDS:${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli" |
12 | 12 | ||
@@ -19,23 +19,14 @@ inherit pkgconfig systemd | |||
19 | SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service" | 19 | SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service" |
20 | SYSTEMD_AUTO_ENABLE = "disable" | 20 | SYSTEMD_AUTO_ENABLE = "disable" |
21 | 21 | ||
22 | SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \ | 22 | SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \ |
23 | file://defconfig \ | 23 | file://defconfig \ |
24 | file://wpa-supplicant.sh \ | 24 | file://wpa-supplicant.sh \ |
25 | file://wpa_supplicant.conf \ | 25 | file://wpa_supplicant.conf \ |
26 | file://wpa_supplicant.conf-sane \ | 26 | file://wpa_supplicant.conf-sane \ |
27 | file://99_wpa_supplicant \ | 27 | file://99_wpa_supplicant \ |
28 | file://0001-replace-systemd-install-Alias-with-WantedBy.patch \ | 28 | " |
29 | file://0001-AP-Silently-ignore-management-frame-from-unexpected-.patch \ | 29 | SRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f" |
30 | file://0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch \ | ||
31 | file://0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch \ | ||
32 | file://0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch \ | ||
33 | file://CVE-2021-0326.patch \ | ||
34 | file://CVE-2021-27803.patch \ | ||
35 | file://CVE-2021-30004.patch \ | ||
36 | " | ||
37 | SRC_URI[md5sum] = "2d2958c782576dc9901092fbfecb4190" | ||
38 | SRC_URI[sha256sum] = "fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17" | ||
39 | 30 | ||
40 | CVE_PRODUCT = "wpa_supplicant" | 31 | CVE_PRODUCT = "wpa_supplicant" |
41 | 32 | ||