Skip to contentSkip to conversation

mac80211: fix oops in ieee80211_beacon_get_tim

PATCH In review Christian Lamparter 3 participants 3 messages Sep 28, 2015 – Sep 29, 2015 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix oops in ieee80211_beacon_get_tim

This patch fixes a crash which is triggered
by __ieee80211_beacon_get returning NULL.
This causes sky_copy to crash later unless
the hardware supports BEACON_TX_STATUS
feature.

---
"mac80211: Copy tx'ed beacons to monitor mode" added the skb_copy. There are few other possibilities to do this. This is just one.

---
 net/mac80211/tx.c | 3 +++
 1 file changed, 3 insertions(+)
net/mac80211/tx.c +3 -0
index f7317a7..666e46b 100644
@@ -3530,6 +3530,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
 	struct ieee80211_supported_band *sband;
 	int shift;
 
+	if (!bcn)
+		return bcn;
+
 	if (tim_offset)
 		*tim_offset = offs.tim_offset;
 
Signature · 1 line
2.5.3
#1 lore raw
Quoted 2 lines · Christian Lamparter

This patch fixes a crash which is triggered
by __ieee80211_beacon_get returning NULL.

Ouch, thanks for catching this!
Helmut

Quoted 27 lines

This causes sky_copy to crash later unless
the hardware supports BEACON_TX_STATUS
feature.

---
"mac80211: Copy tx'ed beacons to monitor mode" added the skb_copy. There are few other possibilities to do this. This is just one.
---
net/mac80211/tx.c | 3 +++

1 file changed, 3 insertions(+)
net/mac80211/tx.c +3 -0
index f7317a7..666e46b 100644
@@ -3530,6 +3530,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct
 ieee80211_hw *hw,
 	struct ieee80211_supported_band *sband;
 	int shift;
 
+	if (!bcn)
+		return bcn;
+
 	if (tim_offset)
 		*tim_offset = offs.tim_offset;
maintainer
#2 lore raw
In reply to Christian Lamparter
Quoted 10 lines · Christian Lamparter

This patch fixes a crash which is triggered
by __ieee80211_beacon_get returning NULL.
This causes sky_copy to crash later unless
the hardware supports BEACON_TX_STATUS
feature.

---
"mac80211: Copy tx'ed beacons to monitor mode" added the skb_copy. There are few other possibilities to do this. This is just one.

Thanks, I rebased this in ...

johannes