* [PATCH] mwifiex: fix large amsdu packets causing firmware hang
@ 2016-07-21 11:00 Amitkumar Karwar
2016-07-21 14:48 ` Kalle Valo
2016-08-18 13:02 ` Kalle Valo
0 siblings, 2 replies; 4+ messages in thread
From: Amitkumar Karwar @ 2016-07-21 11:00 UTC (permalink / raw)
To: linux-wireless; +Cc: Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar
From: Cathy Luo <cluo@marvell.com>
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 <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
drivers/net/wireless/marvell/mwifiex/11n_aggr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
index dc49c3d..c47d636 100644
--- a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
@@ -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);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] mwifiex: fix large amsdu packets causing firmware hang
2016-07-21 11:00 [PATCH] mwifiex: fix large amsdu packets causing firmware hang Amitkumar Karwar
@ 2016-07-21 14:48 ` Kalle Valo
2016-07-21 14:55 ` Amitkumar Karwar
2016-08-18 13:02 ` Kalle Valo
1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2016-07-21 14:48 UTC (permalink / raw)
To: Amitkumar Karwar; +Cc: linux-wireless, Cathy Luo, Nishant Sarmukadam
Amitkumar Karwar <akarwar@marvell.com> writes:
> From: Cathy Luo <cluo@marvell.com>
>
> 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 <cluo@marvell.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Should this go to 4.8 as an important fix?
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] mwifiex: fix large amsdu packets causing firmware hang
2016-07-21 14:48 ` Kalle Valo
@ 2016-07-21 14:55 ` Amitkumar Karwar
0 siblings, 0 replies; 4+ messages in thread
From: Amitkumar Karwar @ 2016-07-21 14:55 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless@vger.kernel.org, Cathy Luo, Nishant Sarmukadam
> From: linux-wireless-owner@vger.kernel.org [mailto:linux-wireless-
> owner@vger.kernel.org] On Behalf Of Kalle Valo
> Sent: Thursday, July 21, 2016 8:19 PM
> To: Amitkumar Karwar
> Cc: linux-wireless@vger.kernel.org; Cathy Luo; Nishant Sarmukadam
> Subject: Re: [PATCH] mwifiex: fix large amsdu packets causing firmware
> hang
>
> Amitkumar Karwar <akarwar@marvell.com> writes:
>
> > From: Cathy Luo <cluo@marvell.com>
> >
> > 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 <cluo@marvell.com>
> > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
>
> Should this go to 4.8 as an important fix?
>
Yes. Please.
Regards,
Amitkumar.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mwifiex: fix large amsdu packets causing firmware hang
2016-07-21 11:00 [PATCH] mwifiex: fix large amsdu packets causing firmware hang Amitkumar Karwar
2016-07-21 14:48 ` Kalle Valo
@ 2016-08-18 13:02 ` Kalle Valo
1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2016-08-18 13:02 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: linux-wireless, Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar
Amitkumar Karwar <akarwar@marvell.com> wrote:
> From: Cathy Luo <cluo@marvell.com>
>
> 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 <cluo@marvell.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Thanks, 1 patch applied to wireless-drivers.git:
c81396f3da22 mwifiex: fix large amsdu packets causing firmware hang
--
Sent by pwcli
https://patchwork.kernel.org/patch/9241469/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-18 13:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 11:00 [PATCH] mwifiex: fix large amsdu packets causing firmware hang Amitkumar Karwar
2016-07-21 14:48 ` Kalle Valo
2016-07-21 14:55 ` Amitkumar Karwar
2016-08-18 13:02 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox