Patch "mac80211: Fix ieee80211_amsdu_aggregate frag_tail bug" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mac80211: Fix ieee80211_amsdu_aggregate frag_tail bug

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mac80211-fix-ieee80211_amsdu_aggregate-frag_tail-bug.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8109844741566243949136267e025415ff662c36
Author: Chih-Kang Chang <gary.chang@xxxxxxxxxxx>
Date:   Mon Aug 30 15:32:40 2021 +0800

    mac80211: Fix ieee80211_amsdu_aggregate frag_tail bug
    
    [ Upstream commit fe94bac626d9c1c5bc98ab32707be8a9d7f8adba ]
    
    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: 6e0456b54545 ("mac80211: add A-MSDU tx support")
    Signed-off-by: Chih-Kang Chang <gary.chang@xxxxxxxxxxx>
    Signed-off-by: Zong-Zhe Yang <kevin_yang@xxxxxxxxxxx>
    Signed-off-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210830073240.12736-1-pkshih@xxxxxxxxxxx
    [reword comment]
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 5c5908127fcb..adeee760ab4c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3264,6 +3264,14 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata,
 	if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head))
 		goto out;
 
+	/* If n == 2, the "while (*frag_tail)" loop above didn't execute
+	 * and  frag_tail should be &skb_shinfo(head)->frag_list.
+	 * However, ieee80211_amsdu_prepare_head() can reallocate it.
+	 * Reload frag_tail to have it pointing to the correct place.
+	 */
+	if (n == 2)
+		frag_tail = &skb_shinfo(head)->frag_list;
+
 	/*
 	 * Pad out the previous subframe to a multiple of 4 by adding the
 	 * padding to the next one, that's being added. Note that head->len



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux