Skip to content

Commit

Permalink
mwifiex: fix large amsdu packets causing firmware hang
Browse files Browse the repository at this point in the history
Sometimes host prepares and downloads a large amsdu packet to firmware
which leads to a memory corruption in firmware.
The reason is __dev_alloc_skb() may allocate larger buffer than required
size. This patch solves the problem by checking "adapter->tx_buf_size"
instead of relying on skb_tailroom().

Signed-off-by: Cathy Luo <[email protected]>
Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
Cathy Luo authored and Kalle Valo committed Aug 18, 2016
1 parent 184ca82 commit c81396f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireless/marvell/mwifiex/11n_aggr.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,

do {
/* Check if AMSDU can accommodate this MSDU */
if (skb_tailroom(skb_aggr) < (skb_src->len + LLC_SNAP_LEN))
if ((skb_aggr->len + skb_src->len + LLC_SNAP_LEN) >
adapter->tx_buf_size)
break;

skb_src = skb_dequeue(&pra_list->skb_head);
Expand Down

0 comments on commit c81396f

Please sign in to comment.