From: Johannes Berg <johannes@sipsolutions.net>
To: Emmanuel Grumbach <egrumbach@gmail.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: mac80211 drops packet with old IV after rekeying
Date: Sat, 16 May 2015 21:57:09 +0200 [thread overview]
Message-ID: <1431806229.2120.6.camel@sipsolutions.net> (raw)
In-Reply-To: <CANUX_P2Xf9i9P3G5LgUm0bjCMSMpQwecJ1S4qH6RuurrkuSp-A@mail.gmail.com> (sfid-20150516_201855_046994_2FA7ED12)
On Sat, 2015-05-16 at 21:18 +0300, Emmanuel Grumbach wrote:
> I don't get it. I might have misunderstood your previous mail, but I
> thought that you were saying the key index was meant to solve this:
> the peer could know what key was used based on the key index written
> in the frame (I guess it is there somehow) so that the Rx handling
> code can know that the jump in the PN is due to a rekeying and not use
> any heuristic. I though you meant that the Txing side had a poor
> implementation because it reused the same key index before and after
> the rekeying which can obviously lead to problems.
> Now you seem to say that changing the key index upon rekeying is not
> allowed by spec?
> What is it good for then?
The key index is used for GTK rekeying. The spec makes no provision for
seamless PTK rekeying, it's simply not supported.
There was/is work in progress to actually change that, but I haven't
seen anything definitive. Jouni might know more.
> Again - I am just trying to close this bug, not to learn this subject.
> I can learn by reading spec / reading code and less by wasting your
> time :)
As I said, I believe at this point the only way to fix this bug is to
try to drop *old* key packets immediately, but it's difficult to ensure
this. Effectively, it would require synchronising RX vs. key
installation.
Using SW crypto will avoid this problem, because as I described in my
first email, the only reason (I can think of anyway) is that there's a
race between HW decrypt and SW key install. In the case of SW crypto,
there's a definitive link between the actual key and the PN because the
frame would fail to decrypt (and thus be dropped) if the wrong key was
used. The problem only happens in HW crypto with software PN because the
two are linked by the key index only.
This (entirely untested) patch might also help:
http://p.sipsolutions.net/3f082fae8a023bbc.txt
johannes
next prev parent reply other threads:[~2015-05-16 19:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 6:48 mac80211 drops packet with old IV after rekeying Emmanuel Grumbach
2015-05-15 7:25 ` Johannes Berg
2015-05-15 7:52 ` Emmanuel Grumbach
2015-05-15 18:35 ` Johannes Berg
2015-05-16 18:18 ` Emmanuel Grumbach
2015-05-16 19:57 ` Johannes Berg [this message]
2015-05-17 16:05 ` Jouni Malinen
2015-05-17 18:23 ` Emmanuel Grumbach
2015-05-17 19:25 ` Johannes Berg
2015-05-17 19:49 ` Emmanuel Grumbach
2015-05-17 20:05 ` Johannes Berg
2015-05-17 20:13 ` Emmanuel Grumbach
2015-05-17 20:22 ` Johannes Berg
2015-05-18 6:14 ` Peer, Ilan
2015-05-18 8:03 ` Janusz Dziedzic
2015-05-18 14:40 ` Ben Greear
2015-05-18 15:02 ` Johannes Berg
2015-05-18 19:34 ` Emmanuel Grumbach
2015-05-18 19:47 ` Alexander Wetzel
2015-05-18 21:55 ` Johannes Berg
2015-05-20 20:55 ` mac80211 drops packet with old IV after rekeying - workaround patch for CCMP Alexander Wetzel
2015-05-21 7:11 ` Johannes Berg
2015-05-17 19:14 ` mac80211 drops packet with old IV after rekeying Johannes Berg
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=1431806229.2120.6.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=egrumbach@gmail.com \
--cc=linux-wireless@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 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).