mt76: validate rx CCMP PN
authorFelix Fietkau <nbd@nbd.name>
Thu, 25 Jan 2018 10:44:24 +0000 (11:44 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 26 Jan 2018 09:20:52 +0000 (11:20 +0200)
commit30ce7f4456ae40e970d9e82fe63c5e55147af0c0
tree06b61298712b3cc88b4fbcbaff9d72fc04576655
parent3675302de8e946b9f8db44f55abbac1742f95706
mt76: validate rx CCMP PN

Apparently hardware does not perform CCMP PN validation in hardware, so
we need to take care of this in the driver. This is important for
protecting against replay attacks.

Since validation of fragmented frames is more complex, the CCMP header
for those is preserved. To keep the counter in sync, the first fragment
is verified by both mt76 and mac80211, and all other fragments only by
mac80211.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt76/mac80211.c
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt76x2_init.c
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
drivers/net/wireless/mediatek/mt76/mt76x2_main.c