wifi: fix multi-link element subelement iteration
authorJohannes Berg <johannes.berg@intel.com>
Sat, 17 Sep 2022 01:14:53 +0000 (03:14 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 7 Oct 2022 13:24:15 +0000 (15:24 +0200)
The subelements obviously start after the common data, including
the common multi-link element structure definition itself. This
bug was possibly just hidden by the higher bits of the control
being set to 0, so the iteration just found one bogus element
and most of the code could continue anyway.

Fixes: 0f48b8b88aa9 ("wifi: ieee80211: add definitions for multi-link element")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/ieee80211.h

index f51e939..6252f02 100644 (file)
@@ -4593,7 +4593,7 @@ static inline u8 ieee80211_mle_common_size(const u8 *data)
                return 0;
        }
 
-       return common + mle->variable[0];
+       return sizeof(*mle) + common + mle->variable[0];
 }
 
 /**