Skip to contentSkip to conversation

mac80211: Don't request encryption for proble response

PATCH In review Ivo van Doorn 2 participants 2 messages Jul 1, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Don't request encryption for proble response

Probe responses shouldn't be encrypted, and mac80211 doesn't set the crypto key accordingly. However it didn't set the IEEE80211_TX_CTL_DO_NOT_ENCRYPT flag which means drivers could make an attempt to encrypt it, and causing a NULL pointer dereference when accessing the provided hw_key field.

---

net/mac80211/mlme.c +1 -0
index 7b4d4d4..fd28cd8 100644
@@ -2531,6 +2531,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
 			control->flags |= IEEE80211_TX_CTL_SHORT_PREAMBLE;
 		control->antenna_sel_tx = local->hw.conf.antenna_sel_tx;
 		control->flags |= IEEE80211_TX_CTL_NO_ACK;
+		control->flags |= IEEE80211_TX_CTL_DO_NOT_ENCRYPT;
 		control->control.retry_limit = 1;
 
 		ifsta->probe_resp = skb_copy(skb, GFP_ATOMIC);
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ivo van Doorn

Probe responses shouldn't be encrypted, and mac80211 doesn't set the crypto key accordingly. However it didn't set the IEEE80211_TX_CTL_DO_NOT_ENCRYPT flag which means drivers could make an attempt to encrypt it, and causing a NULL pointer dereference when accessing the provided hw_key field.

Quoted 14 lines

---

net/mac80211/mlme.c +1 -0
index 7b4d4d4..fd28cd8 100644
@@ -2531,6 +2531,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
 			control->flags |= IEEE80211_TX_CTL_SHORT_PREAMBLE;
 		control->antenna_sel_tx = local->hw.conf.antenna_sel_tx;
 		control->flags |= IEEE80211_TX_CTL_NO_ACK;
+		control->flags |= IEEE80211_TX_CTL_DO_NOT_ENCRYPT;
 		control->control.retry_limit = 1;
 
 		ifsta->probe_resp = skb_copy(skb, GFP_ATOMIC);