summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912-01.patch79
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912-02.patch70
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd_2.11.bb2
3 files changed, 151 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912-01.patch b/meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912-01.patch
new file mode 100644
index 0000000000..36660b5880
--- /dev/null
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912-01.patch
@@ -0,0 +1,79 @@
1From 726432d7622cc0088ac353d073b59628b590ea44 Mon Sep 17 00:00:00 2001
2From: Jouni Malinen <j@w1.fi>
3Date: Sat, 25 Jan 2025 11:21:16 +0200
4Subject: [PATCH] RADIUS: Drop pending request only when accepting the response
5
6The case of an invalid authenticator in a RADIUS response could imply
7that the response is not from the correct RADIUS server and as such,
8such a response should be discarded without changing internal state for
9the pending request. The case of an unknown response (RADIUS_RX_UNKNOWN)
10is somewhat more complex since it could have been indicated before
11validating the authenticator. In any case, it seems better to change the
12state for the pending request only when we have fully accepted the
13response.
14
15Allowing the internal state of pending RADIUS request to change based on
16responses that are not fully validation could have allow at least a
17theoretical DoS attack if an attacker were to have means for injecting
18RADIUS messages to the network using the IP address of the real RADIUS
19server and being able to do so more quickly than the real server and
20with the matching identifier from the request header (i.e., either by
21flooding 256 responses quickly or by having means to capture the RADIUS
22request). These should not really be realistic options in a properly
23protected deployment, but nevertheless it is good to be more careful in
24processing RADIUS responses.
25
26Remove a pending RADIUS request from the internal list only when having
27fully accepted a matching RADIUS response, i.e., after one of the
28registered handlers has confirmed that the authenticator is valid and
29processing of the response has succeeded.
30
31Signed-off-by: Jouni Malinen <j@w1.fi>
32
33CVE: CVE-2025-24912
34Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=726432d7622cc0088ac353d073b59628b590ea44]
35Signed-off-by: Peter Marko <peter.marko@siemens.com>
36---
37 src/radius/radius_client.c | 15 +++++++--------
38 1 file changed, 7 insertions(+), 8 deletions(-)
39
40diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
41index 2a7f36170..7909b29a7 100644
42--- a/src/radius/radius_client.c
43+++ b/src/radius/radius_client.c
44@@ -1259,13 +1259,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
45 roundtrip / 100, roundtrip % 100);
46 rconf->round_trip_time = roundtrip;
47
48- /* Remove ACKed RADIUS packet from retransmit list */
49- if (prev_req)
50- prev_req->next = req->next;
51- else
52- radius->msgs = req->next;
53- radius->num_msgs--;
54-
55 for (i = 0; i < num_handlers; i++) {
56 RadiusRxResult res;
57 res = handlers[i].handler(msg, req->msg, req->shared_secret,
58@@ -1276,6 +1269,13 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
59 radius_msg_free(msg);
60 /* fall through */
61 case RADIUS_RX_QUEUED:
62+ /* Remove ACKed RADIUS packet from retransmit list */
63+ if (prev_req)
64+ prev_req->next = req->next;
65+ else
66+ radius->msgs = req->next;
67+ radius->num_msgs--;
68+
69 radius_client_msg_free(req);
70 return;
71 case RADIUS_RX_INVALID_AUTHENTICATOR:
72@@ -1297,7 +1297,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
73 msg_type, hdr->code, hdr->identifier,
74 invalid_authenticator ? " [INVALID AUTHENTICATOR]" :
75 "");
76- radius_client_msg_free(req);
77
78 fail:
79 radius_msg_free(msg);
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912-02.patch b/meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912-02.patch
new file mode 100644
index 0000000000..add2e47048
--- /dev/null
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912-02.patch
@@ -0,0 +1,70 @@
1From 339a334551ca911187cc870f4f97ef08e11db109 Mon Sep 17 00:00:00 2001
2From: Jouni Malinen <quic_jouni@quicinc.com>
3Date: Wed, 5 Feb 2025 19:23:39 +0200
4Subject: [PATCH] RADIUS: Fix pending request dropping
5
6A recent change to this moved the place where the processed RADIUS
7request was removed from the pending list to happen after the message
8handler had been called. This did not take into account possibility of
9the handler adding a new pending request in the list and the prev_req
10pointer not necessarily pointing to the correct entry anymore. As such,
11some of the pending requests could have been lost and that would result
12in not being able to process responses to those requests and also, to a
13memory leak.
14
15Fix this by determining prev_req at the point when the pending request
16is being removed, i.e., after the handler function has already added a
17new entry.
18
19Fixes: 726432d7622c ("RADIUS: Drop pending request only when accepting the response")
20Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
21
22CVE: CVE-2025-24912
23Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=339a334551ca911187cc870f4f97ef08e11db109]
24Signed-off-by: Peter Marko <peter.marko@siemens.com>
25---
26 src/radius/radius_client.c | 10 +++++++---
27 1 file changed, 7 insertions(+), 3 deletions(-)
28
29diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
30index 7909b29a7..d4faa7936 100644
31--- a/src/radius/radius_client.c
32+++ b/src/radius/radius_client.c
33@@ -1099,7 +1099,7 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
34 struct radius_hdr *hdr;
35 struct radius_rx_handler *handlers;
36 size_t num_handlers, i;
37- struct radius_msg_list *req, *prev_req;
38+ struct radius_msg_list *req, *prev_req, *r;
39 struct os_reltime now;
40 struct hostapd_radius_server *rconf;
41 int invalid_authenticator = 0;
42@@ -1224,7 +1224,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
43 break;
44 }
45
46- prev_req = NULL;
47 req = radius->msgs;
48 while (req) {
49 /* TODO: also match by src addr:port of the packet when using
50@@ -1236,7 +1235,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
51 hdr->identifier)
52 break;
53
54- prev_req = req;
55 req = req->next;
56 }
57
58@@ -1270,6 +1268,12 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
59 /* fall through */
60 case RADIUS_RX_QUEUED:
61 /* Remove ACKed RADIUS packet from retransmit list */
62+ prev_req = NULL;
63+ for (r = radius->msgs; r; r = r->next) {
64+ if (r == req)
65+ break;
66+ prev_req = r;
67+ }
68 if (prev_req)
69 prev_req->next = req->next;
70 else
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd_2.11.bb b/meta-oe/recipes-connectivity/hostapd/hostapd_2.11.bb
index daaf2dcd55..a6f7122847 100644
--- a/meta-oe/recipes-connectivity/hostapd/hostapd_2.11.bb
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd_2.11.bb
@@ -12,6 +12,8 @@ SRC_URI = " \
12 file://defconfig \ 12 file://defconfig \
13 file://init \ 13 file://init \
14 file://hostapd.service \ 14 file://hostapd.service \
15 file://CVE-2025-24912-01.patch \
16 file://CVE-2025-24912-02.patch \
15" 17"
16 18
17 19