Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
mac80211: free skb fraglist before freeing the skb
Browse files Browse the repository at this point in the history
mac80211 uses the frag list to build AMSDU. When freeing
the skb, it may not be really freed, since someone is still
holding a reference to it.
In that case, when TCP skb is being retransmitted, the
pointer to the frag list is being reused, while the data
in there is no longer valid.
Since we will never get frag list from the network stack,
as mac80211 doesn't advertise the capability, we can safely
free and nullify it before releasing the SKB.

Signed-off-by: Sara Sharon <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
sara-s authored and jmberg-intel committed Dec 19, 2018
1 parent d350a0f commit 34b1e0e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/mac80211/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,11 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local,
}

ieee80211_led_tx(local);

if (skb_has_frag_list(skb)) {
kfree_skb_list(skb_shinfo(skb)->frag_list);
skb_shinfo(skb)->frag_list = NULL;
}
}

/*
Expand Down

0 comments on commit 34b1e0e

Please sign in to comment.