aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-02-01 00:16:23 +0100
committerAndreas Blaesius <skate4life@gmx.de>2017-03-17 11:02:15 +0100
commitcd9fc21484818da2951670ad5befc5aa7f7ee00c (patch)
tree8b1a6c83e195b3f12af408518b1ec3b0ee528cf4 /net/mac80211
parentf79f2922945ae1d8e4eaf1b113654673b5d2c845 (diff)
downloadkernel_samsung_espresso10-cd9fc21484818da2951670ad5befc5aa7f7ee00c.zip
kernel_samsung_espresso10-cd9fc21484818da2951670ad5befc5aa7f7ee00c.tar.gz
kernel_samsung_espresso10-cd9fc21484818da2951670ad5befc5aa7f7ee00c.tar.bz2
mac80211: fix fragmentation code, particularly for encryption
The "new" fragmentation code (since my rewrite almost 5 years ago) erroneously sets skb->len rather than using skb_trim() to adjust the length of the first fragment after copying out all the others. This leaves the skb tail pointer pointing to after where the data originally ended, and thus causes the encryption MIC to be written at that point, rather than where it belongs: immediately after the data. The impact of this is that if software encryption is done, then a) encryption doesn't work for the first fragment, the connection becomes unusable as the first fragment will never be properly verified at the receiver, the MIC is practically guaranteed to be wrong b) we leak up to 8 bytes of plaintext (!) of the packet out into the air This is only mitigated by the fact that many devices are capable of doing encryption in hardware, in which case this can't happen as the tail pointer is irrelevant in that case. Additionally, fragmentation is not used very frequently and would normally have to be configured manually. Fix this by using skb_trim() properly. Change-Id: I8d800e31b926a9e8b1cb9a3b6d15ebe1417a6a99 Cc: stable@vger.kernel.org Fixes: 2de8e0d999b8 ("mac80211: rewrite fragmentation") Reported-by: Jouni Malinen <j@w1.fi> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/tx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index da878c1..006057c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -874,7 +874,7 @@ static int ieee80211_fragment(struct ieee80211_local *local,
pos += fraglen;
}
- skb->len = hdrlen + per_fragm;
+ skb_trim(skb, hdrlen + per_fragm);
return 0;
}