1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-24 00:56:14 +02:00

mac80211: fix a crash on accessing stale skb->dev references

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33279 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2012-08-27 12:23:25 +00:00
parent f35d1440f0
commit ef286ca0dc

View File

@ -0,0 +1,32 @@
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -517,6 +517,8 @@ void ieee80211_tx_status(struct ieee8021
if (info->flags & IEEE80211_TX_INTFL_NL80211_FRAME_TX) {
u64 cookie = (unsigned long)skb;
+ bool found = false;
+
acked = info->flags & IEEE80211_TX_STAT_ACK;
/*
@@ -524,8 +526,18 @@ void ieee80211_tx_status(struct ieee8021
* we cannot use skb->dev->ieee80211_ptr
*/
- if (ieee80211_is_nullfunc(hdr->frame_control) ||
- ieee80211_is_qos_nullfunc(hdr->frame_control))
+ list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+ if (skb->dev != sdata->dev)
+ continue;
+
+ found = true;
+ break;
+ }
+
+ if (!found)
+ skb->dev = NULL;
+ else if (ieee80211_is_nullfunc(hdr->frame_control) ||
+ ieee80211_is_qos_nullfunc(hdr->frame_control))
cfg80211_probe_status(skb->dev, hdr->addr1,
cookie, acked, GFP_ATOMIC);
else