Skip to content

Commit 51d0af2

Browse files
nbd168jmberg-intel
authored andcommitted
mac80211: allocate tailroom for forwarded mesh packets
Forwarded packets enter the tx path through ieee80211_add_pending_skb, which skips the ieee80211_skb_resize call. Fixes WARN_ON in ccmp_encrypt_skb and resulting packet loss. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 5c14a4d commit 51d0af2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/mac80211/rx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2644,6 +2644,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
26442644
struct ieee80211_sub_if_data *sdata = rx->sdata;
26452645
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
26462646
u16 ac, q, hdrlen;
2647+
int tailroom = 0;
26472648

26482649
hdr = (struct ieee80211_hdr *) skb->data;
26492650
hdrlen = ieee80211_hdrlen(hdr->frame_control);
@@ -2732,8 +2733,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
27322733
if (!ifmsh->mshcfg.dot11MeshForwarding)
27332734
goto out;
27342735

2736+
if (sdata->crypto_tx_tailroom_needed_cnt)
2737+
tailroom = IEEE80211_ENCRYPT_TAILROOM;
2738+
27352739
fwd_skb = skb_copy_expand(skb, local->tx_headroom +
2736-
sdata->encrypt_headroom, 0, GFP_ATOMIC);
2740+
sdata->encrypt_headroom,
2741+
tailroom, GFP_ATOMIC);
27372742
if (!fwd_skb)
27382743
goto out;
27392744

0 commit comments

Comments
 (0)