All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Jouni Malinen <jkm@devicescape.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: kernel: TKIP: replay detected:
Date: Thu, 28 Sep 2006 16:42:10 -0500	[thread overview]
Message-ID: <451C41B2.4090209@lwfinger.net> (raw)
In-Reply-To: <20060928160834.GC9615@instant802.com>

Jouni Malinen wrote:
> 
> TKIP/CCMP are required to use incrementing TSC/PN for each frame. When a
> directed IEEE 802.11 frame is not acknowledged, it will be retransmitted
> (up to a certain limit). This retransmitted frame will use the same
> TSC/PN. However, the duplicate detection routine in the receiver
> (something that happens before TKIP/CCMP processing) should catch these
> cases since the frames from the same source address that use the same
> seq# and fragm# should be dropped at that layer.
> 
> If it can be shown, that these errors are indeed caused by a broken
> transmitter (and that transmitter is not a Linux device for which we
> control the driver code ;-), I would be much more willing to accept
> patches that silence these messages (as long as the replay statistics
> are easily available in other ways) by default, but I would still not
> remove them completely.
> 

I added the following patch to bcm43xx:

Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
+++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
@@ -460,6 +460,9 @@ static s8 bcm43xx_rssinoise_postprocess(
  }
  #endif

+static u16 prev_frame = 0;
+static u16 prev_seq = 0;
+
  int bcm43xx_rx(struct bcm43xx_private *bcm,
  	       struct sk_buff *skb,
  	       struct bcm43xx_rxhdr *rxhdr)
@@ -470,6 +473,7 @@ int bcm43xx_rx(struct bcm43xx_private *b
  	struct ieee80211_rx_stats stats;
  	struct ieee80211_hdr_4addr *wlhdr;
  	u16 frame_ctl;
+	u16 seq_ctl;
  	int is_packet_for_us = 0;
  	int err = -EINVAL;
  	const u16 rxflags1 = le16_to_cpu(rxhdr->flags1);
@@ -544,6 +548,14 @@ int bcm43xx_rx(struct bcm43xx_private *b
  	}

  	frame_ctl = le16_to_cpu(wlhdr->frame_ctl);
+	seq_ctl = le16_to_cpu(wlhdr->seq_ctl);
+
+	if ((frame_ctl == prev_frame) && (seq_ctl == prev_seq))
+		return -EINVAL;
+
+	prev_frame = frame_ctl;
+	prev_seq = seq_ctl;
+
  	if ((frame_ctl & IEEE80211_FCTL_PROTECTED) && !bcm->ieee->host_decrypt) {
  		frame_ctl &= ~IEEE80211_FCTL_PROTECTED;
  		wlhdr->frame_ctl = cpu_to_le16(frame_ctl);		



By dropping those packets with frame_ctl and seq_ctl the same as the values in the previous packet, 
I was able to cut the number of TKIP replay messages, but some still come through. Is this what you 
had in mind, or is there somewhere else that I should be looking?

Larry

  reply	other threads:[~2006-09-28 21:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-24 10:40 kernel: TKIP: replay detected: Elimar Riesebieter
2006-09-25 14:50 ` John W. Linville
2006-09-25 19:13   ` Matthieu CASTET
2006-09-25 20:10     ` Larry Finger
2006-09-28 16:08   ` Jouni Malinen
2006-09-28 21:42     ` Larry Finger [this message]
2006-09-28 22:48       ` Jouni Malinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=451C41B2.4090209@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=jkm@devicescape.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.