From cd1848bb97ae4e626614e7cc4c6f32e7c503421e Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 17 Sep 2022 03:14:53 +0200 Subject: [PATCH] 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 (cherry picked from commit 1177aaa7fe9373c762cd5bf5f5de8517bac989d5) Signed-off-by: Lee Jones Change-Id: I068a4a16eaad463ada5ba976fc065d0ddb058195 --- include/linux/ieee80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 2928605cf54c..9bfb6c28c1ce 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -4465,7 +4465,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]; } /**