From: Johannes Berg Date: Tue, 13 Sep 2016 13:51:03 +0000 (+0200) Subject: nl80211: fix connect keys range check X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~9295^2~162^2~17 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=42ee231cd12c2e1eb015163d04a65950e895d4b7;p=mirror_ubuntu-focal-kernel.git nl80211: fix connect keys range check Only key index 0-3 should be accepted, 4/5 are for IGTKs and cannot be used as connect keys. Fix the range checking to not allow such erroneous configurations. Signed-off-by: Johannes Berg --- diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c11c1ef6daa7..524f5d238c14 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -866,7 +866,7 @@ nl80211_parse_connkeys(struct cfg80211_registered_device *rdev, err = -EINVAL; if (!parse.p.key) goto error; - if (parse.idx < 0 || parse.idx > 4) + if (parse.idx < 0 || parse.idx > 3) goto error; if (parse.def) { if (def)