Skip to contentSkip to conversation

cfg80211: don't dereference NULL chan

PATCH In review Thomas Pedersen 2 participants 3 messages Jan 25, 2013 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfg80211: don't dereference NULL chan

The patch "cfg80211: check radar interface combinations" would dereference chan even though this may be NULL. Fix a page fault when adding a new interface by adding a short-circuit check for NULL.

---

No action required for this to make it into 3.8, right?

 net/wireless/util.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/wireless/util.c +2 -1
index 1c2795d..d1decbc 100644
@@ -1212,7 +1212,8 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
 	case NL80211_IFTYPE_MESH_POINT:
 	case NL80211_IFTYPE_P2P_GO:
 	case NL80211_IFTYPE_WDS:
-		radar_required = !!(chan->flags & IEEE80211_CHAN_RADAR);
+		radar_required = !!(chan &&
+				    chan->flags & IEEE80211_CHAN_RADAR);
 		break;
 	case NL80211_IFTYPE_P2P_CLIENT:
 	case NL80211_IFTYPE_STATION:
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 9 lines · Thomas Pedersen

The patch "cfg80211: check radar interface combinations" would dereference chan even though this may be NULL. Fix a page fault when adding a new interface by adding a short-circuit check for NULL.

---

No action required for this to make it into 3.8, right?

It doesn't have to go to 3.8 since the original patch isn't going there, and I already have the same fix:
683d41ae6755e6ae297ec09603c229795ab9566e

johannes

#2 lore raw
Quoted 6 lines · Johannes Berg
Quoted 5 lines · Thomas Pedersen

The patch "cfg80211: check radar interface combinations" would dereference chan even though this may be NULL. Fix a page fault when adding a new interface by adding a short-circuit check for NULL.

Quoted 6 lines
Quoted 4 lines

---

No action required for this to make it into 3.8, right?

It doesn't have to go to 3.8 since the original patch isn't going there,

Oh then -next would be 3.9, duh.

Quoted 2 lines

and I already have the same fix:
683d41ae6755e6ae297ec09603c229795ab9566e

Thanks!

Signature · 1 line
Thomas