diff options
author | David S. Miller <davem@davemloft.net> | 2015-05-19 16:44:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-19 16:44:25 -0400 |
commit | 892bd6291ac122e3cdb354ef39567c9127768916 (patch) | |
tree | b782591e9bb10828420418b1047d8e69128b5c46 /net | |
parent | b7b0ed910cd8450db6d98cd4361c644bb1c88412 (diff) | |
parent | 47b4e1fc4972cc43a19121bc2608a60aef3bf216 (diff) |
Merge tag 'mac80211-for-davem-2015-05-19' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says:
====================
This has just a single fix, for a WEP tailroom check
problem that leads to dropped frames.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/wep.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index a4220e92f0cc..efa3f48f1ec5 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
@@ -98,8 +98,7 @@ static u8 *ieee80211_wep_add_iv(struct ieee80211_local *local, | |||
98 | 98 | ||
99 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); | 99 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); |
100 | 100 | ||
101 | if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN || | 101 | if (WARN_ON(skb_headroom(skb) < IEEE80211_WEP_IV_LEN)) |
102 | skb_headroom(skb) < IEEE80211_WEP_IV_LEN)) | ||
103 | return NULL; | 102 | return NULL; |
104 | 103 | ||
105 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | 104 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
@@ -167,6 +166,9 @@ int ieee80211_wep_encrypt(struct ieee80211_local *local, | |||
167 | size_t len; | 166 | size_t len; |
168 | u8 rc4key[3 + WLAN_KEY_LEN_WEP104]; | 167 | u8 rc4key[3 + WLAN_KEY_LEN_WEP104]; |
169 | 168 | ||
169 | if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN)) | ||
170 | return -1; | ||
171 | |||
170 | iv = ieee80211_wep_add_iv(local, skb, keylen, keyidx); | 172 | iv = ieee80211_wep_add_iv(local, skb, keylen, keyidx); |
171 | if (!iv) | 173 | if (!iv) |
172 | return -1; | 174 | return -1; |