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)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 10 Oct 2022 07:50:37 +0000 (09:50 +0200)
commit567e14e39e8f8c6997a1378bc3be615afca86063
tree1acfd496cd23c8027f019dd925cf298c3ab06457
parentff05d4b45dd89b922578dac497dcabf57cf771c6
wifi: cfg80211: ensure length byte is present before access

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>
net/wireless/scan.c