All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>, <gary.chang@realtek.com>
Subject: [PATCH 2/2] mac80211: Fix insufficient headroom issue for AMSDU
Date: Mon, 16 Aug 2021 16:51:28 +0800	[thread overview]
Message-ID: <20210816085128.10931-2-pkshih@realtek.com> (raw)
In-Reply-To: <20210816085128.10931-1-pkshih@realtek.com>

From: Chih-Kang Chang <gary.chang@realtek.com>

ieee80211_amsdu_realloc_pad() lacks some check for extra_tx_headroom,
the original reserved headroom might be eaten. So we add the
extra_tx_headroom check.

Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 net/mac80211/tx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 9e0d4fca1c76..a69dc58d9768 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3242,7 +3242,8 @@ static bool ieee80211_amsdu_prepare_head(struct ieee80211_sub_if_data *sdata,
 	if (info->control.flags & IEEE80211_TX_CTRL_AMSDU)
 		return true;
 
-	if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr)))
+	if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr) +
+					 local->hw.extra_tx_headroom))
 		return false;
 
 	data = skb_push(skb, sizeof(*amsdu_hdr));
-- 
2.25.1


  reply	other threads:[~2021-08-16  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16  8:51 [PATCH 1/2] mac80211: Fix ieee80211_amsdu_aggregate frag_tail bug Ping-Ke Shih
2021-08-16  8:51 ` Ping-Ke Shih [this message]
2021-08-16 12:22 ` Felix Fietkau
2021-08-30  6:27   ` Pkshih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210816085128.10931-2-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=gary.chang@realtek.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.