302-mac80211-allocate-tailroom-for-forwarded-mesh-packet.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From: Felix Fietkau <[email protected]>
  2. Date: Fri, 22 Feb 2019 13:21:15 +0100
  3. Subject: [PATCH] mac80211: allocate tailroom for forwarded mesh packets
  4. Forwarded packets enter the tx path through ieee80211_add_pending_skb,
  5. which skips the ieee80211_skb_resize call.
  6. Fixes WARN_ON in ccmp_encrypt_skb and resulting packet loss.
  7. Cc: [email protected]
  8. Signed-off-by: Felix Fietkau <[email protected]>
  9. Signed-off-by: Johannes Berg <[email protected]>
  10. ---
  11. --- a/net/mac80211/rx.c
  12. +++ b/net/mac80211/rx.c
  13. @@ -2598,6 +2598,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
  14. struct ieee80211_sub_if_data *sdata = rx->sdata;
  15. struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
  16. u16 ac, q, hdrlen;
  17. + int tailroom = 0;
  18. hdr = (struct ieee80211_hdr *) skb->data;
  19. hdrlen = ieee80211_hdrlen(hdr->frame_control);
  20. @@ -2684,8 +2685,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
  21. if (!ifmsh->mshcfg.dot11MeshForwarding)
  22. goto out;
  23. + if (sdata->crypto_tx_tailroom_needed_cnt)
  24. + tailroom = IEEE80211_ENCRYPT_TAILROOM;
  25. +
  26. fwd_skb = skb_copy_expand(skb, local->tx_headroom +
  27. - sdata->encrypt_headroom, 0, GFP_ATOMIC);
  28. + sdata->encrypt_headroom,
  29. + tailroom, GFP_ATOMIC);
  30. if (!fwd_skb)
  31. goto out;