wifi: cfg80211/mac80211: Fix ML element common size validation
authorIlan Peer <ilan.peer@intel.com>
Sun, 11 Sep 2022 13:55:12 +0000 (16:55 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 7 Oct 2022 13:23:53 +0000 (15:23 +0200)
The Multi-Link element can be fragmented, thus its size can exceed 254.
Thus, modify ieee80211_mle_size_ok() to use 'size_t len' instead of
'u8 len'.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/ieee80211.h

index 442b133..b935a85 100644 (file)
@@ -4601,7 +4601,7 @@ static inline u8 ieee80211_mle_common_size(const u8 *data)
  * @data: pointer to the element data
  * @len: length of the containing element
  */
-static inline bool ieee80211_mle_size_ok(const u8 *data, u8 len)
+static inline bool ieee80211_mle_size_ok(const u8 *data, size_t len)
 {
        const struct ieee80211_multi_link_elem *mle = (const void *)data;
        u8 fixed = sizeof(*mle);