summaryrefslogtreecommitdiff
path: root/net/mac80211/key.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-06 21:59:39 +0200
committerJohn W. Linville <linville@tuxdriver.com>2011-07-08 11:11:19 -0400
commitaba83a0b301c32dbb91c017f33307611e1a1d384 (patch)
tree9f8478ddf2160c9b4c50666e037e6239ea52e274 /net/mac80211/key.h
parent523b02ea23b175dd3e46e3daf1bc9354376640a3 (diff)
mac80211: fix CCMP races
Since we can process multiple packets at the same time for different ACs, but the PN is allocated from a single counter, we need to use an atomic value there. Use atomic64_t to make this cheaper on 64-bit platforms, other platforms will support this through software emulation, see lib/atomic64.c. We also need to use an on-stack scratch buf so that multiple packets won't corrupt each others scratch buffers. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/key.h')
-rw-r--r--net/mac80211/key.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/mac80211/key.h b/net/mac80211/key.h
index 1493c3e56b9f..05ce4c0203fc 100644
--- a/net/mac80211/key.h
+++ b/net/mac80211/key.h
@@ -82,7 +82,7 @@ struct ieee80211_key {
struct tkip_ctx rx[NUM_RX_DATA_QUEUES];
} tkip;
struct {
- u8 tx_pn[6];
+ atomic64_t tx_pn;
/*
* Last received packet number. The first
* NUM_RX_DATA_QUEUES counters are used with Data
@@ -92,12 +92,9 @@ struct ieee80211_key {
u8 rx_pn[NUM_RX_DATA_QUEUES + 1][6];
struct crypto_cipher *tfm;
u32 replays; /* dot11RSNAStatsCCMPReplays */
- /* scratch buffers for virt_to_page() (crypto API) */
#ifndef AES_BLOCK_LEN
#define AES_BLOCK_LEN 16
#endif
- u8 tx_crypto_buf[6 * AES_BLOCK_LEN];
- u8 rx_crypto_buf[6 * AES_BLOCK_LEN];
} ccmp;
struct {
u8 tx_pn[6];