Skip to contentSkip to conversation

nl80211: fix null-ptr dereference on invalid mesh configuration

PATCH New Johannes Berg 1 participant 1 message Sep 18, 2017 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 nl80211: fix null-ptr dereference on invalid mesh configuration

From: Johannes Berg <[email protected]>

If TX rates are specified during mesh join, the channel must also be specified. Check the channel pointer to avoid a null pointer dereference if it isn't.

Fixes 8564e38206de ("cfg80211: add checks for beacon rate, extend to mesh")
---
 net/wireless/nl80211.c | 3 +++
 1 file changed, 3 insertions(+)
net/wireless/nl80211.c +3 -0
index 8ce85420ecb0..dfc8e6fff677 100644
@@ -9987,6 +9987,9 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
 		if (err)
 			return err;
 
+		if (!setup.chandef.chan)
+			return -EINVAL;
+
 		err = validate_beacon_tx_rate(rdev, setup.chandef.chan->band,
 					      &setup.beacon_rate);
 		if (err)
Signature · 1 line
2.14.1