diff mbox

mac80211: WEP extra head/tail room in ieee80211_send_auth

Message ID 1402419608-11892-1-git-send-email-emmanuel.grumbach@intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Emmanuel Grumbach June 10, 2014, 5 p.m. UTC
From: Max Stepanov <Max.Stepanov@intel.com>

After skb allocation and call to ieee80211_wep_encrypt in ieee80211_send_auth
the flow fails with a warning in ieee80211_wep_add_iv on verification of
available head/tailroom needed for WEP_IV and WEP_ICV.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/util.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Johannes Berg June 13, 2014, 6:01 p.m. UTC | #1
On Tue, 2014-06-10 at 20:00 +0300, Emmanuel Grumbach wrote:
> From: Max Stepanov <Max.Stepanov@intel.com>
> 
> After skb allocation and call to ieee80211_wep_encrypt in ieee80211_send_auth
> the flow fails with a warning in ieee80211_wep_add_iv on verification of
> available head/tailroom needed for WEP_IV and WEP_ICV.

Applied. There's still time - should that be Cc stable?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo June 14, 2014, 8 a.m. UTC | #2
Johannes Berg <johannes@sipsolutions.net> writes:

> On Tue, 2014-06-10 at 20:00 +0300, Emmanuel Grumbach wrote:
>> From: Max Stepanov <Max.Stepanov@intel.com>
>> 
>> After skb allocation and call to ieee80211_wep_encrypt in ieee80211_send_auth
>> the flow fails with a warning in ieee80211_wep_add_iv on verification of
>> available head/tailroom needed for WEP_IV and WEP_ICV.
>
> Applied. There's still time - should that be Cc stable?

Is this a regression?
Johannes Berg June 14, 2014, 7:59 p.m. UTC | #3
On Sat, 2014-06-14 at 11:00 +0300, Kalle Valo wrote:
> Johannes Berg <johannes@sipsolutions.net> writes:
> 
> > On Tue, 2014-06-10 at 20:00 +0300, Emmanuel Grumbach wrote:
> >> From: Max Stepanov <Max.Stepanov@intel.com>
> >> 
> >> After skb allocation and call to ieee80211_wep_encrypt in ieee80211_send_auth
> >> the flow fails with a warning in ieee80211_wep_add_iv on verification of
> >> available head/tailroom needed for WEP_IV and WEP_ICV.
> >
> > Applied. There's still time - should that be Cc stable?
> 
> Is this a regression?

Good question. I don't think anything changed this code recently, but
maybe something changed skb allocation or so? Max?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 4a0f3ae..1cc4d82 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1125,11 +1125,12 @@  void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
 	int err;
 
 	/* 24 + 6 = header + auth_algo + auth_transaction + status_code */
-	skb = dev_alloc_skb(local->hw.extra_tx_headroom + 24 + 6 + extra_len);
+	skb = dev_alloc_skb(local->hw.extra_tx_headroom + IEEE80211_WEP_IV_LEN +
+			    24 + 6 + extra_len + IEEE80211_WEP_ICV_LEN);
 	if (!skb)
 		return;
 
-	skb_reserve(skb, local->hw.extra_tx_headroom);
+	skb_reserve(skb, local->hw.extra_tx_headroom + IEEE80211_WEP_IV_LEN);
 
 	mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24 + 6);
 	memset(mgmt, 0, 24 + 6);