]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ieee80211: fix ieee80211_mle_basic_sta_prof_size_ok()
authorJohannes Berg <johannes.berg@intel.com>
Mon, 18 Mar 2024 16:53:18 +0000 (18:53 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Mar 2024 14:38:12 +0000 (15:38 +0100)
If there was a possibility of an MLE basic STA profile without
subelements, we might reject it because we account for the one
octet for sta_info_len twice (it's part of itself, and in the
fixed portion). Like in ieee80211_mle_reconf_sta_prof_size_ok,
subtract 1 to adjust that.

When reading the elements we did take this into account, and
since there are always elements, this never really mattered.

Fixes: 7b6f08771bf6 ("wifi: ieee80211: Support validating ML station profile length")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.00bb0b20ed60.I8c41dd6fc14c4b187ab901dea15ade73c79fb98c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/ieee80211.h

index a99f048404b8643ecf03dd531e77e9e4c25f2d4b..4fd9735bb75e50117f1895095f0f0da20448b783 100644 (file)
@@ -5302,7 +5302,7 @@ static inline bool ieee80211_mle_basic_sta_prof_size_ok(const u8 *data,
                info_len += 1;
 
        return prof->sta_info_len >= info_len &&
-              fixed + prof->sta_info_len <= len;
+              fixed + prof->sta_info_len - 1 <= len;
 }
 
 /**