You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
wifi: cfg80211: fix buffer overflow in elem comparison
[ Upstream commit9f16b5c82a] For vendor elements, the code here assumes that 5 octets are present without checking. Since the element itself is already checked to fit, we only need to check the length. Reported-and-tested-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de> Fixes:0b8fb8235b("cfg80211: Parsing of Multiple BSSID information in scanning") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6922948c2e
commit
9e6b79a3cd
@@ -330,7 +330,8 @@ static size_t cfg80211_gen_new_ie(const u8 *ie, size_t ielen,
|
|||||||
* determine if they are the same ie.
|
* determine if they are the same ie.
|
||||||
*/
|
*/
|
||||||
if (tmp_old[0] == WLAN_EID_VENDOR_SPECIFIC) {
|
if (tmp_old[0] == WLAN_EID_VENDOR_SPECIFIC) {
|
||||||
if (!memcmp(tmp_old + 2, tmp + 2, 5)) {
|
if (tmp_old[1] >= 5 && tmp[1] >= 5 &&
|
||||||
|
!memcmp(tmp_old + 2, tmp + 2, 5)) {
|
||||||
/* same vendor ie, copy from
|
/* same vendor ie, copy from
|
||||||
* subelement
|
* subelement
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user