diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-09-18 22:46:36 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-19 22:47:11 +0200 |
commit | 4fa029fc3500bac120df4f03fa9edd421ef53d3e (patch) | |
tree | e708b82fc21bdf6614b71d5d2c56ee5117c1bc2d /net | |
parent | 07a6134db045493a6e932fdfdc48bcf1e201e4ca (diff) |
nl80211: fix null-ptr dereference on invalid mesh configuration
commit 265698d7e6132a2d41471135534f4f36ad15b09c upstream.
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: 8564e38206de ("cfg80211: add checks for beacon rate, extend to mesh")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/nl80211.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 146d83785b37..6afac189d20f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -9481,6 +9481,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) |