android_kernel_motorola_sm6225/net/wireless
Anant Thazhemadam 1e9cd487b0 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:24:04 +02:00
..
certs cfg80211: ship certificates as hex files 2017-12-19 09:28:01 +01:00
.gitignore cfg80211: implement regdb signature checking 2017-10-11 14:24:24 +02:00
ap.c cfg80211: call disconnect_wk when AP stops 2019-12-01 09:17:34 +01:00
chan.c cfg80211: enable use of non-cleared DFS channels for DFS offload 2018-03-29 10:21:35 +02:00
core.c {nl,mac}80211: fix interface combinations on crypto controlled devices 2019-09-16 08:21:42 +02:00
core.h nl80211: validate key indexes for cfg80211_registered_device 2021-06-10 13:24:04 +02:00
debugfs.c
debugfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ethtool.c cfg80211: check wiphy driver existence for drvinfo report 2020-03-05 16:42:13 +01:00
ibss.c nl80211: Add SOCKET_OWNER support to JOIN_IBSS 2018-03-29 10:36:22 +02:00
Kconfig cfg80211: add missing dependency to CFG80211 suboptions 2018-02-27 10:54:12 +01:00
lib80211.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
lib80211_crypt_ccmp.c
lib80211_crypt_tkip.c wireless/lib80211: Convert from ahash to shash 2018-07-24 09:17:20 +02:00
lib80211_crypt_wep.c
Makefile wireless: Skip directory when generating certificates 2019-11-10 11:27:54 +01:00
mesh.c nl80211: Add SOCKET_OWNER support to JOIN_MESH 2018-03-29 10:38:24 +02:00
mlme.c cfg80211: fix CAC_STARTED event handling 2018-03-29 10:21:16 +02:00
nl80211.c nl80211: validate key indexes for cfg80211_registered_device 2021-06-10 13:24:04 +02:00
nl80211.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
ocb.c
of.c
radiotap.c
rdev-ops.h cfg80211: Fix radar event during another phy CAC 2020-02-05 14:43:46 +00:00
reg.c cfg80211: regulatory: Fix inconsistent format argument 2020-11-18 19:18:45 +01:00
reg.h cfg80211: implement regdb signature checking 2017-10-11 14:24:24 +02:00
scan.c cfg80211: scan: drop entry from hidden_list on overflow 2021-05-22 10:59:25 +02:00
sme.c cfg80211: remove WARN_ON() in cfg80211_sme_connect 2021-04-14 08:22:36 +02:00
sysfs.c cfg80211: track time using boottime 2018-06-29 09:49:28 +02:00
sysfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.c
trace.h cfg80211: Fix radar event during another phy CAC 2020-02-05 14:43:46 +00:00
util.c nl80211: validate key indexes for cfg80211_registered_device 2021-06-10 13:24:04 +02:00
wext-compat.c cfg80211: initialize on-stack chandefs 2019-10-11 18:21:09 +02:00
wext-compat.h
wext-core.c wext: fix NULL-ptr-dereference with cfg80211's lack of commit() 2021-02-03 23:23:24 +01:00
wext-priv.c
wext-proc.c proc: introduce proc_create_net{,_data} 2018-05-16 07:24:30 +02:00
wext-sme.c cfg80211: wext: avoid copying malformed SSIDs 2019-10-29 09:19:52 +01:00
wext-spy.c