All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] mac80211: check skb_linearize() return value
@ 2016-09-14 10:08 Johannes Berg
  2016-09-14 11:06 ` Felix Fietkau
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2016-09-14 10:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Felix Fietkau, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

The A-MSDU TX code (within TXQs) didn't always check the return value
of skb_linearize() properly, resulting in potentially passing a frag-
list SKB down to the driver even when it said it can't handle it. Fix
that.

Fixes: 6e0456b545456 ("mac80211: add A-MSDU tx support")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/tx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index cc8e95554b48..18b285e06bc8 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1515,8 +1515,12 @@ out:
 	spin_unlock_bh(&fq->lock);
 
 	if (skb && skb_has_frag_list(skb) &&
-	    !ieee80211_hw_check(&local->hw, TX_FRAG_LIST))
-		skb_linearize(skb);
+	    !ieee80211_hw_check(&local->hw, TX_FRAG_LIST)) {
+		if (skb_linearize(skb)) {
+			ieee80211_free_txskb(&local->hw, skb);
+			return NULL;
+		}
+	}
 
 	return skb;
 }
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] mac80211: check skb_linearize() return value
  2016-09-14 10:08 [PATCH v3] mac80211: check skb_linearize() return value Johannes Berg
@ 2016-09-14 11:06 ` Felix Fietkau
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Fietkau @ 2016-09-14 11:06 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: Felix Fietkau, Johannes Berg

On 2016-09-14 12:08, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> The A-MSDU TX code (within TXQs) didn't always check the return value
> of skb_linearize() properly, resulting in potentially passing a frag-
> list SKB down to the driver even when it said it can't handle it. Fix
> that.
> 
> Fixes: 6e0456b545456 ("mac80211: add A-MSDU tx support")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Felix Fietkau <nbd@nbd.name>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-14 11:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14 10:08 [PATCH v3] mac80211: check skb_linearize() return value Johannes Berg
2016-09-14 11:06 ` Felix Fietkau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.