UPSTREAM: wifi: fix multi-link element subelement iteration

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.

Bug: 254441685
Fixes: 0f48b8b88aa9 ("wifi: ieee80211: add definitions for multi-link element")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 1177aaa7fe9373c762cd5bf5f5de8517bac989d5)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Iec90b3aa981ce0d90aaa7e6d92bf061418c62bde
This commit is contained in:
Johannes Berg
2022-09-17 03:14:53 +02:00
committed by Lee Jones
parent 0cc04953f0
commit 2f6641fde7

View File

@@ -4476,7 +4476,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];
}
/**