mt76: do not pass the received frame with decryption error
authorXing Song <xing.song@mediatek.com>
Fri, 19 Nov 2021 06:37:06 +0000 (14:37 +0800)
committerFelix Fietkau <nbd@nbd.name>
Sun, 19 Dec 2021 14:23:59 +0000 (15:23 +0100)
commitdd28dea52ad9376d2b243a8981726646e1f60b1a
tree5b668e253a64381b7e52f75acd33dc8f29261353
parentdfdf6725d5e0e1465507ea57dbd64119cf8e19a9
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>
drivers/net/wireless/mediatek/mt76/mt7603/mac.c
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
drivers/net/wireless/mediatek/mt76/mt7921/mac.c