Skip to content

Commit 98849ba

Browse files
committed
wifi: mac80211: check defragmentation succeeded
We need to check that cfg80211_defragment_element() didn't return an error, since it can fail due to bad input, and we didn't catch that before. Fixes: 8eb8dd2 ("wifi: mac80211: Support link removal using Reconfiguration ML element") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20231211085121.8595a6b67fc0.I1225edd8f98355e007f96502e358e476c7971d8c@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 63bafd9 commit 98849ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/mac80211/mlme.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5782,7 +5782,7 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata,
57825782
{
57835783
const struct ieee80211_multi_link_elem *ml;
57845784
const struct element *sub;
5785-
size_t ml_len;
5785+
ssize_t ml_len;
57865786
unsigned long removed_links = 0;
57875787
u16 link_removal_timeout[IEEE80211_MLD_MAX_NUM_LINKS] = {};
57885788
u8 link_id;
@@ -5798,6 +5798,8 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata,
57985798
elems->scratch + elems->scratch_len -
57995799
elems->scratch_pos,
58005800
WLAN_EID_FRAGMENT);
5801+
if (ml_len < 0)
5802+
return;
58015803

58025804
elems->ml_reconf = (const void *)elems->scratch_pos;
58035805
elems->ml_reconf_len = ml_len;

0 commit comments

Comments
 (0)