Skip to contentSkip to conversation

FAILED: patch "[PATCH] mac80211: validate extended element ID is present" failed to apply to 5.4-stable tree

PATCH [email protected] 1 participant 1 message Dec 17, 2021

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 768c0b19b50665e337c96858aa2b7928d6dcf756 Mon Sep 17 00:00:00 2001
From: Johannes Berg <[email protected]>
Date: Sat, 11 Dec 2021 20:10:24 +0100
Subject: [PATCH] mac80211: validate extended element ID is present

Before attempting to parse an extended element, verify that the extended element ID is present.

net/mac80211/util.c +6 -1
index 43df2f0c5db9..6c2934854d3c 100644
@@ -943,7 +943,12 @@ static void ieee80211_parse_extension_element(u32 *crc,
 					      struct ieee802_11_elems *elems)
 {
 	const void *data = elem->data + 1;
-	u8 len = elem->datalen - 1;
+	u8 len;
+
+	if (!elem->datalen)
+		return;
+
+	len = elem->datalen - 1;
 
 	switch (elem->data[0]) {
 	case WLAN_EID_EXT_HE_MU_EDCA: