From e9396ad2378fe735cbbb6d23f5d7b1abc9b3efe4 Mon Sep 17 00:00:00 2001 From: Michael-CY Lee Date: Wed, 30 Oct 2024 17:48:32 +0800 Subject: [PATCH] wifi: mt76: mt7996: remove unnecessary key->cipher check for BIP frames Also avoids a use-after-free bug that still needs to be fixed in mac80211 Signed-off-by: Michael-CY Lee Signed-off-by: Felix Fietkau --- mt7996/mac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mt7996/mac.c b/mt7996/mac.c index 0d68c16e..44864d1c 100644 --- a/mt7996/mac.c +++ b/mt7996/mac.c @@ -773,8 +773,7 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi, info->flags & IEEE80211_TX_CTL_USE_MINRATE) val |= MT_TXD1_FIXED_RATE; - if (key && multicast && ieee80211_is_robust_mgmt_frame(skb) && - key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) { + if (key && multicast && ieee80211_is_robust_mgmt_frame(skb)) { val |= MT_TXD1_BIP; txwi[3] &= ~cpu_to_le32(MT_TXD3_PROTECT_FRAME); }