developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 1 | From 6729cb3a0f853e59cb67fcadad70c138967ba534 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Thu, 25 Jan 2024 14:07:23 +0800 |
| 4 | Subject: [PATCH] mac80211: mtk: fix AP mgmt not encrypted in WDS mode with PMF on |
| 5 | |
| 6 | mtk: mac80211: fix AP mgmt not encrypted in WDS mode with PMF on |
| 7 | |
| 8 | In ieee80211_tx_prepare(), if tx->sta is still NULL after calling |
| 9 | sta_info_get(), the skb might be mgmt for WDS peer, so sta_info_get_bss() |
| 10 | if called to find sta from AP_VLAN, and then interface type & 4-addr |
| 11 | using is checked. |
| 12 | |
| 13 | Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 14 | |
| 15 | --- |
| 16 | net/mac80211/tx.c | 7 +++++++ |
| 17 | 1 file changed, 7 insertions(+) |
| 18 | |
| 19 | diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c |
| 20 | index e071130..6daa5a9 100644 |
| 21 | --- a/net/mac80211/tx.c |
| 22 | +++ b/net/mac80211/tx.c |
| 23 | @@ -1214,6 +1214,13 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, |
| 24 | if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) { |
| 25 | tx->sta = sta_info_get(sdata, hdr->addr1); |
| 26 | aggr_check = true; |
| 27 | + |
| 28 | + if (!tx->sta) { |
| 29 | + tx->sta = sta_info_get_bss(sdata, hdr->addr1); |
| 30 | + if (!tx->sta || !tx->sta->sdata->wdev.use_4addr || |
| 31 | + !(tx->sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) |
| 32 | + tx->sta = NULL; |
| 33 | + } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | -- |
| 38 | 2.25.1 |
| 39 | |