linux/net/wireless
Anant Thazhemadam 0338fa4af9 nl80211: validate key indexes for cfg80211_registered_device
commit 2d9463083ce92636a1bdd3e30d1236e3e95d859e upstream

syzbot discovered a bug in which an OOB access was being made because
an unsuitable key_idx value was wrongly considered to be acceptable
while deleting a key in nl80211_del_key().

Since we don't know the cipher at the time of deletion, if
cfg80211_validate_key_settings() were to be called directly in
nl80211_del_key(), even valid keys would be wrongly determined invalid,
and deletion wouldn't occur correctly.
For this reason, a new function - cfg80211_valid_key_idx(), has been
created, to determine if the key_idx value provided is valid or not.
cfg80211_valid_key_idx() is directly called in 2 places -
nl80211_del_key(), and cfg80211_validate_key_settings().

Reported-by: syzbot+49d4cab497c2142ee170@syzkaller.appspotmail.com
Tested-by: syzbot+49d4cab497c2142ee170@syzkaller.appspotmail.com
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Link: https://lore.kernel.org/r/20201204215825.129879-1-anant.thazhemadam@gmail.com
Cc: stable@vger.kernel.org
[also disallow IGTK key IDs if no IGTK cipher is supported]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-10 13:37:02 +02:00
..
certs
.gitignore
Kconfig lib80211: fix unmet direct dependendices config warning when !CRYPTO 2020-10-01 13:18:20 +02:00
Makefile
ap.c
chan.c nl80211: Disallow setting of HT for channel 14 2019-10-30 10:07:22 +01:00
core.c cfg80211: initialize wdev data earlier 2020-11-18 19:20:23 +01:00
core.h nl80211: validate key indexes for cfg80211_registered_device 2021-06-10 13:37:02 +02:00
debugfs.c
debugfs.h
ethtool.c cfg80211: check wiphy driver existence for drvinfo report 2020-03-05 16:43:36 +01:00
ibss.c cfg80211: ibss: use 11a mandatory rates for 6GHz band operation 2019-08-21 10:54:57 +02:00
lib80211.c
lib80211_crypt_ccmp.c lib80211: use crypto API ccm(aes) transform for CCMP processing 2019-07-26 13:22:47 +02:00
lib80211_crypt_tkip.c
lib80211_crypt_wep.c
mesh.c
mlme.c
nl80211.c nl80211: validate key indexes for cfg80211_registered_device 2021-06-10 13:37:02 +02:00
nl80211.h
ocb.c
of.c
pmsr.c
radiotap.c
rdev-ops.h cfg80211: Fix radar event during another phy CAC 2020-02-05 21:22:46 +00:00
reg.c cfg80211: regulatory: Fix inconsistent format argument 2020-11-18 19:20:23 +01:00
reg.h mac80211: fix scan when operating on DFS channels in ETSI domains 2019-10-07 22:10:50 +02:00
scan.c cfg80211: scan: drop entry from hidden_list on overflow 2021-05-14 09:44:13 +02:00
sme.c cfg80211: remove WARN_ON() in cfg80211_sme_connect 2021-04-14 08:24:18 +02:00
sysfs.c
sysfs.h
trace.c
trace.h cfg80211: Fix radar event during another phy CAC 2020-02-05 21:22:46 +00:00
util.c nl80211: validate key indexes for cfg80211_registered_device 2021-06-10 13:37:02 +02:00
wext-compat.c cfg80211: initialize on-stack chandefs 2019-10-01 17:56:18 +02:00
wext-compat.h
wext-core.c wext: fix NULL-ptr-dereference with cfg80211's lack of commit() 2021-02-03 23:25:56 +01:00
wext-priv.c
wext-proc.c
wext-sme.c cfg80211: wext: avoid copying malformed SSIDs 2019-10-04 14:04:08 +02:00
wext-spy.c