Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38852b20 authored by Senthil Balasubramanian's avatar Senthil Balasubramanian Committed by John W. Linville
Browse files

ath9k: Fix STA disconnect issue due to received MIC failed bcast frames



AR_RxKeyIdxValid will not be set for bcast/mcast frames and so relying
this status for MIC failed frames is buggy.

Due to this, MIC failure events for broadcast frames are not sent to
supplicant resulted in AP disconnecting the STA.

Able to pass Wifi Test case 5.2.18 with this fix.

Cc: Stable <stable@kernel.org> (2.6.36+)
Signed-off-by: default avatarSenthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 080e1a25
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -703,8 +703,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
			rs->rs_phyerr = phyerr;
		} else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
			rs->rs_status |= ATH9K_RXERR_DECRYPT;
		else if ((ads.ds_rxstatus8 & AR_MichaelErr) &&
		         rs->rs_keyix != ATH9K_RXKEYIX_INVALID)
		else if (ads.ds_rxstatus8 & AR_MichaelErr)
			rs->rs_status |= ATH9K_RXERR_MIC;
		else if (ads.ds_rxstatus8 & AR_KeyMiss)
			rs->rs_status |= ATH9K_RXERR_DECRYPT;
+8 −1
Original line number Diff line number Diff line
@@ -838,6 +838,10 @@ static bool ath9k_rx_accept(struct ath_common *common,
			    struct ath_rx_status *rx_stats,
			    bool *decrypt_error)
{
#define is_mc_or_valid_tkip_keyix ((is_mc ||			\
		(rx_stats->rs_keyix != ATH9K_RXKEYIX_INVALID && \
		test_bit(rx_stats->rs_keyix, common->tkip_keymap))))

	struct ath_hw *ah = common->ah;
	__le16 fc;
	u8 rx_status_len = ah->caps.rx_status_len;
@@ -879,15 +883,18 @@ static bool ath9k_rx_accept(struct ath_common *common,
		if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) {
			*decrypt_error = true;
		} else if (rx_stats->rs_status & ATH9K_RXERR_MIC) {
			bool is_mc;
			/*
			 * The MIC error bit is only valid if the frame
			 * is not a control frame or fragment, and it was
			 * decrypted using a valid TKIP key.
			 */
			is_mc = !!is_multicast_ether_addr(hdr->addr1);

			if (!ieee80211_is_ctl(fc) &&
			    !ieee80211_has_morefrags(fc) &&
			    !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) &&
			    test_bit(rx_stats->rs_keyix, common->tkip_keymap))
			    is_mc_or_valid_tkip_keyix)
				rxs->flag |= RX_FLAG_MMIC_ERROR;
			else
				rx_stats->rs_status &= ~ATH9K_RXERR_MIC;