diff options
author | Xing Song <xing.song@mediatek.com> | 2021-11-19 09:37:06 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-12-19 17:23:59 +0300 |
commit | dd28dea52ad9376d2b243a8981726646e1f60b1a (patch) | |
tree | 5b668e253a64381b7e52f75acd33dc8f29261353 /drivers/net/wireless/mediatek/mt76/mt7603 | |
parent | dfdf6725d5e0e1465507ea57dbd64119cf8e19a9 (diff) | |
download | linux-dd28dea52ad9376d2b243a8981726646e1f60b1a.tar.xz |
mt76: do not pass the received frame with decryption error
MAC80211 doesn't care any decryption error in 802.3 path, so received
frame will be dropped if HW tell us that the cipher configuration is not
matched as well as the header has been translated to 802.3. This case only
appears when IEEE80211_FCTL_PROTECTED is 0 and cipher suit is not none in
the corresponding HW entry.
The received frame is only reported to monitor interface if HW decryption
block tell us there is ICV error or CCMP/BIP/WPI MIC error. Note in this
case the reported frame is decrypted 802.11 frame and the payload may be
malformed due to mismatched key.
Signed-off-by: Xing Song <xing.song@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7603')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index fe03e31989bb..a9ac61b9f854 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -525,6 +525,10 @@ mt7603_mac_fill_rx(struct mt7603_dev *dev, struct sk_buff *skb) if (rxd2 & MT_RXD2_NORMAL_TKIP_MIC_ERR) status->flag |= RX_FLAG_MMIC_ERROR; + /* ICV error or CCMP/BIP/WPI MIC error */ + if (rxd2 & MT_RXD2_NORMAL_ICV_ERR) + status->flag |= RX_FLAG_ONLY_MONITOR; + if (FIELD_GET(MT_RXD2_NORMAL_SEC_MODE, rxd2) != 0 && !(rxd2 & (MT_RXD2_NORMAL_CLM | MT_RXD2_NORMAL_CM))) { status->flag |= RX_FLAG_DECRYPTED; |