Commit 265698d7 authored by Johannes Berg's avatar Johannes Berg

nl80211: fix null-ptr dereference on invalid mesh configuration

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.
Reported-by: default avatarJouni Malinen <j@w1.fi>
Fixes: 8564e382 ("cfg80211: add checks for beacon rate, extend to mesh")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e785fa0a
...@@ -9987,6 +9987,9 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info) ...@@ -9987,6 +9987,9 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
if (err) if (err)
return err; return err;
if (!setup.chandef.chan)
return -EINVAL;
err = validate_beacon_tx_rate(rdev, setup.chandef.chan->band, err = validate_beacon_tx_rate(rdev, setup.chandef.chan->band,
&setup.beacon_rate); &setup.beacon_rate);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment