dropbear: Fix CVE-2020-36254
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 371-mac80211-fix-fast-rx-encryption-check.patch
1 From b70798906c4c85314511cf6d5cae98385861fc07 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Fri, 18 Dec 2020 19:47:17 +0100
4 Subject: [PATCH] mac80211: fix fast-rx encryption check
5
6 [ Upstream commit 622d3b4e39381262da7b18ca1ed1311df227de86 ]
7
8 When using WEP, the default unicast key needs to be selected, instead of
9 the STA PTK.
10
11 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 Link: https://lore.kernel.org/r/20201218184718.93650-5-nbd@nbd.name
13 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
14 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 ---
16 net/mac80211/rx.c | 2 ++
17 1 file changed, 2 insertions(+)
18
19 --- a/net/mac80211/rx.c
20 +++ b/net/mac80211/rx.c
21 @@ -4019,6 +4019,8 @@ void ieee80211_check_fast_rx(struct sta_
22
23 rcu_read_lock();
24 key = rcu_dereference(sta->ptk[sta->ptk_idx]);
25 + if (!key)
26 + key = rcu_dereference(sdata->default_unicast_key);
27 if (key) {
28 switch (key->conf.cipher) {
29 case WLAN_CIPHER_SUITE_TKIP: