diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-02-19 15:30:45 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-02-27 19:23:54 +0300 |
commit | 64d1519edc959f5b8f86a66a51c40971c215e4ec (patch) | |
tree | 3d6ae3eff86f2b40701bdf85a9d0e5f78888159e /drivers/net/wireless/broadcom | |
parent | 2d6edad4b2da1991f74e7b02053eeb4a043b887f (diff) | |
download | linux-64d1519edc959f5b8f86a66a51c40971c215e4ec.tar.xz |
brcmfmac: reject too long PSK
nl80211 already allows specifying 48 bytes, but brcmfmac
only supports 32. Reject keys that are too long.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/broadcom')
-rw-r--r-- | drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 15fa00d79fc6..74a83020c073 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -5124,6 +5124,9 @@ static int brcmf_cfg80211_set_pmk(struct wiphy *wiphy, struct net_device *dev, if (WARN_ON(ifp->vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_1X)) return -EINVAL; + if (conf->pmk_len > BRCMF_WSEC_MAX_PSK_LEN) + return -ERANGE; + return brcmf_set_pmk(ifp, conf->pmk, conf->pmk_len); } |