]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: cfg80211: ensure length byte is present before access
authorJohannes Berg <johannes.berg@intel.com>
Thu, 29 Sep 2022 19:50:44 +0000 (21:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Oct 2022 06:01:44 +0000 (08:01 +0200)
commit867184200c057a9efdd815dfacefe85e5f2586a7
tree210c53074f5ad8e6f600c418dcf56c3e8e744c56
parente6d77ac0132da7e73fdcc4a38dd4c40ac0226466
wifi: cfg80211: ensure length byte is present before access

commit 567e14e39e8f8c6997a1378bc3be615afca86063 upstream.

When iterating the elements here, ensure the length byte is
present before checking it to see if the entire element will
fit into the buffer.

Longer term, we should rewrite this code using the type-safe
element iteration macros that check all of this.

Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning")
Reported-by: Soenke Huster <shuster@seemoo.tu-darmstadt.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/scan.c