From: Johan Hovold <johan.hovold@lundinova.se>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] ath9k: corrupt frames forwarded to mac80211 as decrypted (was: ath9k: receive stops working in AP-mode and 802.11n)
Date: Fri, 16 Apr 2010 12:48:50 +0200 [thread overview]
Message-ID: <20100416104850.GA13329@lundinova.se> (raw)
In-Reply-To: <20100331191058.GD18913@lundinova.se>
Hi,
I now know why 802.11n receive stalls; ath9k is passing corrupt frames to
mac80211.
The corrupt frames are marked as decrypted so the receive PN is updated to a
random number. Later non-corrupt frames with correct PNs are consequently
deemed out-of-sequence and are dropped. Connection is restored at re-keying as
this resets the queue PN.
I noted that some of the corrupt frames may be caught in the driver by closer
inspection of the associated rx status. By modifying the receive processing I
am able to catch most corrupt frames. Unfortunately, there are still some that
seem impossible to identify without actually looking at the actual frames.
An example of such a frame is:
00000000: 88 41 30 00 00 80 48 68 08 0f 00 21 6a 56 2c 36
00000010: 00 22 02 00 0b 63 20 52 00 00 20 21 21 05 00 20
00000020: 8a 39 7b 1f 0f 11 07 9e bd 53 80 33 3b 8c 98 00
00000030: ef 5f da 7c 9a d6 3d d7 59 ac e0 21 44 88 63 d7
00000040: 21 34 b7 9a 89 8e cf 9e 46 1c ee d6 81 56 25 59
00000050: d2 ec ac 33 e6 12 3d c5 02 61 2d 80 8d 30 44 1e
00000060: 79 74 79 79 62 25 ba ec 04 4d 54 dc
with associated status
rxstatus8 = 1e989103
Here nothing in the frame status indicates an error; the frame has no error
flags set, the frame-ok flag is set, and so on. Still the frame is indeed
corrupt; the last four octets of the CCMP-header (bytes 0x20..0x23) should
be {00,00,00,00} rather than {8a,39,7b,1f} as the correct PN is 0x0521 (not
0x1f7b398a0521).
The corrupt frames all seem to have the upper half of the CCMP-header, data
and MIC corrupted, whereas the FCS (last four bytes) seem to be correct in the
sense that they match what I see in the air (and is verified by wireshark).
One explanation for all of this could be that the corrupt packet is what the
hardware is expected to return should it's processing fail (e.g. due to
checksum error). Then the problem is merely that the status field sometimes
get corrupted (some frames with corrupt PN do indeed come with matching
rxstatus). Comments in the code concerning corrupt status fields also point in
this direction.
Another explanation could be that the status is actually correct but for some
reason the returned frame is corrupted. Perhaps it's a combination of both
corrupt status and frame.
Any ideas about what may be going on here?
As I mentioned above I can catch most corrupt frames with the following changes
to the rx processing:
ath9k: clean up rx skb post-process logic
ath9k: do not mark frames with RXKEY_IX_INVALID as decrypted
ath9k: do not mark frames with RX_DECRYPT_BUSY as decrypted
ath9k: do not mark frames with RX_KEY_MISS as decrypted
ath9k: check error flags even if rx frame is marked ok
ath9k: clear mic error flag on encrypted frames
drivers/net/wireless/ath/ath9k/common.c | 16 ++++++++--------
drivers/net/wireless/ath/ath9k/mac.c | 26 +++++++++++++-------------
drivers/net/wireless/ath/ath9k/mac.h | 1 +
3 files changed, 22 insertions(+), 21 deletions(-)
The last change reduces the number of false MIC-errors that leads hostapd to
trigger countermeasures.
I might be violating the semantics of the error flags with some of these
changes, but it does make sense if indeed the status flags are getting
corrupted. For instance, if the FrameOK flag is erroneously set the remaining
error flags would never be checked. My change make sure the error flags are
always checked. Of course this may also, if the error flags get set due to status
corruption, lead to occasional false negatives which would have to be resend,
but this is better than passing false positives to mac80211 which breaks
communication completely.
I'm responding to this mail with the aforementioned patches against linux-next
from 20100413.
I'm still using AR9280.
Thanks,
Johan Hovold
next prev parent reply other threads:[~2010-04-16 10:48 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 19:10 [ath9k-devel] ath9k: receive stops working in AP-mode and 802.11n Johan Hovold
2010-04-16 10:48 ` Johan Hovold [this message]
2010-04-16 10:52 ` [ath9k-devel] [RFC][PATCH 1/6] ath9k: clean up rx skb post-process logic Johan Hovold
2010-04-16 10:52 ` [ath9k-devel] [RFC][PATCH 2/6] ath9k: do not mark frames with RXKEY_IX_INVALID as decrypted Johan Hovold
2010-04-16 11:32 ` Jouni Malinen
2010-04-20 8:35 ` Johan Hovold
2010-04-16 10:52 ` [ath9k-devel] [RFC][PATCH 3/6] ath9k: do not mark frames with RX_DECRYPT_BUSY " Johan Hovold
2010-04-16 10:52 ` [ath9k-devel] [RFC][PATCH 4/6] ath9k: do not mark frames with RX_KEY_MISS " Johan Hovold
2010-04-16 10:52 ` [ath9k-devel] [RFC][PATCH 5/6] ath9k: check error flags even if rx frame is marked ok Johan Hovold
2010-04-16 10:52 ` [ath9k-devel] [RFC][PATCH 6/6] ath9k: clear mic error flag on encrypted frames Johan Hovold
2010-04-20 8:25 ` [ath9k-devel] ath9k: corrupt frames forwarded to mac80211 as decrypted Johan Hovold
2010-04-20 8:28 ` [ath9k-devel] [RFC][PATCH 1/2] ath9k: fix corrupt frames being forwarded to mac80211 Johan Hovold
2010-04-20 8:38 ` Johan Hovold
2010-04-20 8:28 ` [ath9k-devel] [RFC][PATCH 2/2] ath9k: use also AR_DecryptBusyErr to determine decrypt errors Johan Hovold
2010-04-20 9:10 ` [ath9k-devel] ath9k: corrupt frames forwarded to mac80211 as decrypted Ranga Rao Ravuri
2010-04-20 11:06 ` Johan Hovold
2010-04-20 11:35 ` Johan Hovold
2010-04-29 8:26 ` Daniel Yingqiang Ma
2010-04-29 8:41 ` Tor Krill
2010-04-29 9:35 ` Daniel Yingqiang Ma
2010-04-29 18:08 ` Ben Gamari
2010-04-29 20:08 ` Will Dyson
2010-04-30 9:07 ` Tor Krill
2010-04-29 20:21 ` Benoit PAPILLAULT
2010-04-30 9:50 ` Tor Krill
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=20100416104850.GA13329@lundinova.se \
--to=johan.hovold@lundinova.se \
--cc=ath9k-devel@lists.ath9k.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox