Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d109cef authored by Jeff Johnson's avatar Jeff Johnson Committed by Greg Kroah-Hartman
Browse files

wifi: cw1200: Avoid processing an invalid TIM IE



[ Upstream commit b7bcea9c27b3d87b54075735c870500123582145 ]

While converting struct ieee80211_tim_ie::virtual_map to be a flexible
array it was observed that the TIM IE processing in cw1200_rx_cb()
could potentially process a malformed IE in a manner that could result
in a buffer over-read. Add logic to verify that the TIM IE length is
large enough to hold a valid TIM payload before processing it.

Signed-off-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230831-ieee80211_tim_ie-v3-1-e10ff584ab5d@quicinc.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b0862789
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1173,7 +1173,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
		size_t ies_len = skb->len - (ies - (u8 *)(skb->data));

		tim_ie = cfg80211_find_ie(WLAN_EID_TIM, ies, ies_len);
		if (tim_ie) {
		if (tim_ie && tim_ie[1] >= sizeof(struct ieee80211_tim_ie)) {
			struct ieee80211_tim_ie *tim =
				(struct ieee80211_tim_ie *)&tim_ie[2];