Skip to content

Commit fe94bac

Browse files
Chih-Kang Changjmberg-intel
Chih-Kang Chang
authored andcommitted
mac80211: Fix ieee80211_amsdu_aggregate frag_tail bug
In ieee80211_amsdu_aggregate() set a pointer frag_tail point to the end of skb_shinfo(head)->frag_list, and use it to bind other skb in the end of this function. But when execute ieee80211_amsdu_aggregate() ->ieee80211_amsdu_realloc_pad()->pskb_expand_head(), the address of skb_shinfo(head)->frag_list will be changed. However, the ieee80211_amsdu_aggregate() not update frag_tail after call pskb_expand_head(). That will cause the second skb can't bind to the head skb appropriately.So we update the address of frag_tail to fix it. Fixes: 6e0456b ("mac80211: add A-MSDU tx support") Signed-off-by: Chih-Kang Chang <[email protected]> Signed-off-by: Zong-Zhe Yang <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected] [reword comment] Signed-off-by: Johannes Berg <[email protected]>
1 parent 98d46b0 commit fe94bac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/mac80211/tx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3380,6 +3380,14 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata,
33803380
if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head))
33813381
goto out;
33823382

3383+
/* If n == 2, the "while (*frag_tail)" loop above didn't execute
3384+
* and frag_tail should be &skb_shinfo(head)->frag_list.
3385+
* However, ieee80211_amsdu_prepare_head() can reallocate it.
3386+
* Reload frag_tail to have it pointing to the correct place.
3387+
*/
3388+
if (n == 2)
3389+
frag_tail = &skb_shinfo(head)->frag_list;
3390+
33833391
/*
33843392
* Pad out the previous subframe to a multiple of 4 by adding the
33853393
* padding to the next one, that's being added. Note that head->len

0 commit comments

Comments
 (0)