Skip to content

Commit 265698d

Browse files
committed
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: Jouni Malinen <j@w1.fi> Fixes: 8564e38 ("cfg80211: add checks for beacon rate, extend to mesh") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent e785fa0 commit 265698d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/wireless/nl80211.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9987,6 +9987,9 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
99879987
if (err)
99889988
return err;
99899989

9990+
if (!setup.chandef.chan)
9991+
return -EINVAL;
9992+
99909993
err = validate_beacon_tx_rate(rdev, setup.chandef.chan->band,
99919994
&setup.beacon_rate);
99929995
if (err)

0 commit comments

Comments
 (0)