aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2017-10-26 15:31:15 +0200
committerJonas Gorski <jonas.gorski@gmail.com>2017-10-26 15:41:07 +0200
commit1dcd8e7cf1c7a84dc658ff55f84b34887860311f (patch)
tree67d95db5bd98aaf5f4267f3728ad3332e407df75 /package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch
parent34958c826915cf864833ed8ba6e5b49d44c6cb41 (diff)
downloadupstream-1dcd8e7cf1c7a84dc658ff55f84b34887860311f.tar.gz
upstream-1dcd8e7cf1c7a84dc658ff55f84b34887860311f.tar.bz2
upstream-1dcd8e7cf1c7a84dc658ff55f84b34887860311f.zip
mac80211: backport fixes for fix for CVE-2017-13080
Backport two fixes for the fix of CVE-2017-13080, preventing side channel attacks and making it work for TKIP. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch')
-rw-r--r--package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch b/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch
new file mode 100644
index 0000000000..03e8201902
--- /dev/null
+++ b/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch
@@ -0,0 +1,33 @@
+From 2bdd713b92a9cade239d3c7d15205a09f556624d Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Tue, 17 Oct 2017 20:32:07 +0200
+Subject: [PATCH] mac80211: use constant time comparison with keys
+
+Otherwise we risk leaking information via timing side channel.
+
+Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything")
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+ net/mac80211/key.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/mac80211/key.c
++++ b/net/mac80211/key.c
+@@ -19,6 +19,7 @@
+ #include <linux/slab.h>
+ #include <linux/export.h>
+ #include <net/mac80211.h>
++#include <crypto/algapi.h>
+ #include <asm/unaligned.h>
+ #include "ieee80211_i.h"
+ #include "driver-ops.h"
+@@ -635,7 +636,7 @@ int ieee80211_key_link(struct ieee80211_
+ * new version of the key to avoid nonce reuse or replay issues.
+ */
+ if (old_key && key->conf.keylen == old_key->conf.keylen &&
+- !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) {
++ !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) {
+ ieee80211_key_free_unused(key);
+ ret = 0;
+ goto out;