mac80211: fix A-MSDU packet handling with TCP retransmission
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 351-mac80211-free-skb-fraglist-before-freeing-the-skb.patch
1 From: Sara Sharon <sara.sharon@intel.com>
2 Date: Thu, 11 Oct 2018 14:21:21 +0200
3 Subject: [PATCH] mac80211: free skb fraglist before freeing the skb
4
5 mac80211 uses the frag list to build AMSDU. When freeing
6 the skb, it may not be really freed, since someone is still
7 holding a reference to it.
8 In that case, when TCP skb is being retransmitted, the
9 pointer to the frag list is being reused, while the data
10 in there is no longer valid.
11 Since we will never get frag list from the network stack,
12 as mac80211 doesn't advertise the capability, we can safely
13 free and nullify it before releasing the SKB.
14
15 Signed-off-by: Sara Sharon <sara.sharon@intel.com>
16 ---
17
18 --- a/net/mac80211/status.c
19 +++ b/net/mac80211/status.c
20 @@ -561,6 +561,11 @@ static void ieee80211_report_used_skb(st
21 }
22
23 ieee80211_led_tx(local);
24 +
25 + if (skb_has_frag_list(skb)) {
26 + kfree_skb_list(skb_shinfo(skb)->frag_list);
27 + skb_shinfo(skb)->frag_list = NULL;
28 + }
29 }
30
31 /*