b43: Always drop crypt-failed packets.
PATCH 1/1 b43: Always drop crypt-failed packets.
Drop packets for which the firmware was unable to decrypt it, as we won't be able to decrypt them with the key, too.
Cc Johannes Berg <[email protected]>
Signed-off-by Michael Buesch <[email protected]>
drivers/net/wireless/b43/xmit.c +8 -2
@@ -465,6 +465,12 @@ void b43_rx(struct b43_wldev *dev, strucif (macstat &B43_RX_MAC_FCSERR ) dev->wl->ieee_stats.dot11FCSErrorCount++; +if (macstat &B43_RX_MAC_DECERR ) { +/* Decryption with the given key failed. +* Drop the packet. We also won't be able to decrypt it with +* the key in software. */ + goto drop; + }/* Skip PLCP and padding */ padding = (macstat &B43_RX_MAC_PADDING ) ?2 :0 ;
@@ -483,7 +489,7 @@ void b43_rx(struct b43_wldev *dev, struc fctl =le16_to_cpu (wlhdr->frame_control);skb_trim (skb, skb->len -FCS_LEN ); -if ((macstat &B43_RX_MAC_DEC ) && !(macstat &B43_RX_MAC_DECERR )) { +if (macstat &B43_RX_MAC_DEC ) {unsigned int keyidx;int wlhdr_len;int iv_len;
@@ -573,7 +579,7 @@ void b43_rx(struct b43_wldev *dev, strucieee80211_rx_irqsafe (dev->wl->hw, skb, &status);return ; - drop: +drop:b43dbg (dev->wl,"RX: Packet dropped\n" );dev_kfree_skb_any (skb); }