diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2017-02-04 11:08:42 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-02-06 01:42:47 -0500 |
commit | 01fba20b5976e445676febbdf6dc78d71c6d7b62 (patch) | |
tree | 59358197378bdac3509767b02531bf30b2b79f50 | |
parent | e479ab651f071dbd1518ce8fb121c7f42f2bb97d (diff) |
mac80211: Allocate a sync skcipher explicitly for FILS AEAD
The skcipher could have been of the async variant which may return from
skcipher_encrypt() with -EINPROGRESS after having queued the request.
The FILS AEAD implementation here does not have code for dealing with
that possibility, so allocate a sync cipher explicitly to avoid
potential issues with hardware accelerators.
This is based on the patch sent out by Ard.
Fixes: 39404feee691 ("mac80211: FILS AEAD protection for station mode association frames")
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/fils_aead.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/fils_aead.c b/net/mac80211/fils_aead.c index e795aaa2aa1f..5c3af5eb4052 100644 --- a/net/mac80211/fils_aead.c +++ b/net/mac80211/fils_aead.c | |||
@@ -124,7 +124,7 @@ static int aes_siv_encrypt(const u8 *key, size_t key_len, | |||
124 | 124 | ||
125 | /* CTR */ | 125 | /* CTR */ |
126 | 126 | ||
127 | tfm2 = crypto_alloc_skcipher("ctr(aes)", 0, 0); | 127 | tfm2 = crypto_alloc_skcipher("ctr(aes)", 0, CRYPTO_ALG_ASYNC); |
128 | if (IS_ERR(tfm2)) { | 128 | if (IS_ERR(tfm2)) { |
129 | kfree(tmp); | 129 | kfree(tmp); |
130 | return PTR_ERR(tfm2); | 130 | return PTR_ERR(tfm2); |
@@ -183,7 +183,7 @@ static int aes_siv_decrypt(const u8 *key, size_t key_len, | |||
183 | 183 | ||
184 | /* CTR */ | 184 | /* CTR */ |
185 | 185 | ||
186 | tfm2 = crypto_alloc_skcipher("ctr(aes)", 0, 0); | 186 | tfm2 = crypto_alloc_skcipher("ctr(aes)", 0, CRYPTO_ALG_ASYNC); |
187 | if (IS_ERR(tfm2)) | 187 | if (IS_ERR(tfm2)) |
188 | return PTR_ERR(tfm2); | 188 | return PTR_ERR(tfm2); |
189 | /* K2 for CTR */ | 189 | /* K2 for CTR */ |