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