From: Johannes Berg Date: Mon, 18 Sep 2017 20:46:36 +0000 (+0200) Subject: nl80211: fix null-ptr dereference on invalid mesh configuration X-Git-Tag: v4.14-rc2~10^2~33^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=265698d7e6132a2d41471135534f4f36ad15b09c;p=platform%2Fkernel%2Flinux-exynos.git 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 Fixes: 8564e38206de ("cfg80211: add checks for beacon rate, extend to mesh") Signed-off-by: Johannes Berg --- diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index fbd5593..6908742 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -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)