326-v4.17-0001-brcmfmac-reject-too-long-PSK.patch 992 B

123456789101112131415161718192021222324252627
  1. From 64d1519edc959f5b8f86a66a51c40971c215e4ec Mon Sep 17 00:00:00 2001
  2. From: Johannes Berg <[email protected]>
  3. Date: Mon, 19 Feb 2018 13:30:45 +0100
  4. Subject: [PATCH] brcmfmac: reject too long PSK
  5. nl80211 already allows specifying 48 bytes, but brcmfmac
  6. only supports 32. Reject keys that are too long.
  7. Signed-off-by: Johannes Berg <[email protected]>
  8. Acked-by: Arend van Spriel <[email protected]>
  9. Signed-off-by: Kalle Valo <[email protected]>
  10. ---
  11. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +++
  12. 1 file changed, 3 insertions(+)
  13. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  14. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  15. @@ -5125,6 +5125,9 @@ static int brcmf_cfg80211_set_pmk(struct
  16. if (WARN_ON(ifp->vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_1X))
  17. return -EINVAL;
  18. + if (conf->pmk_len > BRCMF_WSEC_MAX_PSK_LEN)
  19. + return -ERANGE;
  20. +
  21. return brcmf_set_pmk(ifp, conf->pmk, conf->pmk_len);
  22. }