From: Jouni Malinen <j@w1.fi>
To: wim torfs <wtorfs@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Adrian Chadd <adrian@freebsd.org>,
"Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
Kalle Valo <kvalo@codeaurora.org>,
QCA ath9k Development <ath9k-devel@qca.qualcomm.com>,
"ath9k-devel@lists.ath9k.org" <ath9k-devel@lists.ath9k.org>,
Linux Wireless List <linux-wireless@vger.kernel.org>
Subject: Re: AR9462 problems connecting again..
Date: Mon, 23 Feb 2015 13:05:50 +0200 [thread overview]
Message-ID: <20150223110550.GA4569@w1.fi> (raw)
In-Reply-To: <54EB0722.2030509@gmail.com>
On Mon, Feb 23, 2015 at 11:55:30AM +0100, wim torfs wrote:
> If it is the case that the 4-way handshake fails, then I have seen
> this issue before. The problem is that messages 1 to 4 are sent with
> the previous key. However, right after sending message 4/4, does
> wpa_supplicant set the new key. In some cases, such as in a high
> throughput environment, this could result that the key is set even
> before the last packet is sent out. As a result, the AP receives a
> packet which is encrypted with the wrong key, since it still listens
> with the old key.
The specific case here is not PTK rekeying, i.e., it is for the initial
4-way handshake, so there is no previous pairwise key in place. That
said, I guess it would be possible for some drivers to hit this even
with the initial PTK configuration if hardware acceleration is used for
encryption and the frame gets delayed sufficiently long while waiting
for medium access.
> A solution would be to adjust wpa_supplicant to wait for the
> transmission ack before it sets its key, however, this causes issues
> with the key reception and transmission count, which could be
> circumvented by copying the old counter values upon setting the new
> key, but this is a dirty hack. Another solution would require some
> more invasive operations, that is, the new key should somehow be
> linked to the message 4/4 and should only be set by the driver upon
> transmission of the message 4/4.
I've been thinking of adding EAPOL TX status reporting into
wpa_supplicant at least to make the debug log more helpful. However,
this does indeed cause issues for RX and I'm not really sure I'd like to
delay pairwise key configuration. The proper way of handling this would
be by doing what the standard really implies, i.e., configure the key
for RX only at first and then enable it for TX after EAPOL-Key msg 4/4
has been transmitted. Though, that should really be interpreted with
something like "enable for TX after the AP has used the key" due to this
possibility for retransmissions of EAPOL-Key 3/4. That said, there are
corner cases even with this design, e.g., due to the STA wanting to
transmit Data frames to the AP immediately after EAPOL-Key 4/4; those
should really be encrypted, so the behavior here would likely need to be
conditional on ethertype (RX-only for EAPOL, RX+TX for everything else).
Things get even messier with PTK rekeying when there would actually need
to be support for two keys (even with the same key index..) so that the
retransmitted EAPOL-Key 3/4 case could be detected and replied to in a
way that the AP understands the response. This gets unfortunately ugly
and I'd assume almost no station implements this in a way that would
handle all cases cleanly (i.e., just hope for msg 4/4 to go through and
reassociate as a backup plan if things fail..).
--
Jouni Malinen PGP id EFC895FA
next prev parent reply other threads:[~2015-02-23 11:05 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-21 23:34 AR9462 problems connecting again Linus Torvalds
2015-02-22 6:50 ` Sujith Manoharan
2015-02-22 17:55 ` Linus Torvalds
2015-02-22 18:24 ` Adrian Chadd
2015-02-22 18:30 ` Linus Torvalds
2015-02-22 18:58 ` [ath9k-devel] " Dave Taht
2015-02-22 21:45 ` Linus Torvalds
[not found] ` <CAM9PttgYK3e75c2XZ6G2nPXw=UR95-xVwO0LBqrXRPFcABkgTA@mail.gmail.com>
2015-02-22 21:56 ` Kyle Bassett
2015-02-22 19:39 ` Adrian Chadd
2015-02-22 21:50 ` Linus Torvalds
2015-02-22 23:00 ` Linus Torvalds
2015-02-23 0:54 ` Adrian Chadd
2015-02-23 1:41 ` Linus Torvalds
2015-02-23 1:55 ` Adrian Chadd
2015-02-23 1:59 ` Linus Torvalds
2015-02-23 2:05 ` Adrian Chadd
2015-02-23 5:46 ` [ath9k-devel] " Sujith Manoharan
2015-02-23 6:01 ` Sujith Manoharan
2015-02-23 10:37 ` Jouni Malinen
2015-02-23 10:55 ` wim torfs
2015-02-23 11:05 ` Jouni Malinen [this message]
2015-02-23 17:17 ` Jouni Malinen
2015-02-23 18:00 ` Emmanuel Grumbach
2015-02-23 20:06 ` Linus Torvalds
2015-02-23 20:11 ` Linus Torvalds
2015-02-23 21:30 ` Jouni Malinen
2015-02-23 21:53 ` Linus Torvalds
2015-02-23 22:22 ` Adrian Chadd
2015-02-23 22:43 ` Jouni Malinen
2015-02-23 23:00 ` Linus Torvalds
2015-02-23 23:13 ` Jouni Malinen
2015-02-24 0:29 ` Sujith Manoharan
[not found] ` <CAA_e5Z4zuDMS+CJvFbw4F5M9OZxgS-NZzL2E3d3GSvpRr_TbQw@mail.gmail.com>
2015-02-24 2:29 ` Andrew McGregor
2015-02-24 10:26 ` Jouni Malinen
2015-02-24 16:58 ` [ath9k-devel] " Dave Taht
2015-02-24 17:54 ` Thomas Hühn
2015-02-24 18:14 ` Jouni Malinen
2015-02-24 22:38 ` Thomas Hühn
2015-02-24 22:50 ` Adrian Chadd
2015-02-25 14:53 ` Jouni Malinen
2015-02-25 20:52 ` Thomas Hühn
2015-02-25 5:00 ` Felix Fietkau
2015-02-25 14:47 ` Jouni Malinen
2015-02-25 18:14 ` Linus Torvalds
2015-02-25 18:25 ` Peter Stuge
2015-02-25 20:22 ` Adrian Chadd
2015-02-26 5:02 ` Andrew McGregor
2015-02-26 5:55 ` Linus Torvalds
2015-02-26 10:01 ` Arend van Spriel
2015-02-26 10:20 ` Jouni Malinen
2015-02-26 16:04 ` Peter Stuge
2015-02-26 19:03 ` Adrian Chadd
2015-02-23 1:24 ` Sujith Manoharan
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=20150223110550.GA4569@w1.fi \
--to=j@w1.fi \
--cc=adrian@freebsd.org \
--cc=ath9k-devel@lists.ath9k.org \
--cc=ath9k-devel@qca.qualcomm.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@do-not-panic.com \
--cc=torvalds@linux-foundation.org \
--cc=wtorfs@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).