linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <egrumbach@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Peer, Ilan" <ilan.peer@intel.com>,
	"alexander.wetzel@web.de" <alexander.wetzel@web.de>,
	Jouni Malinen <j@w1.fi>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: mac80211 drops packet with old IV after rekeying
Date: Mon, 18 May 2015 22:34:20 +0300	[thread overview]
Message-ID: <CANUX_P1gfcq9_qiZSDwqNzu2PCcw-DEfu7JkSHZqb8UHmyWU8g@mail.gmail.com> (raw)
In-Reply-To: <1431961331.10489.1.camel@sipsolutions.net>

On Mon, May 18, 2015 at 6:02 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2015-05-18 at 06:14 +0000, Peer, Ilan wrote:
>
>> There is probably no synchronization between the 4way HS and other
>> data traffic on the transmitter side, as these are different
>> processes. So it is possible that after receiving message 3 and before
>> setting the keys, the HW would be able to decrypt additional frames
>> with the old key.
>
> Right. I think the "new key with old PN" part is probably not really
> happening, although it seems possible. I'd think we should look at the
> receiver first and only then move on to the transmitter if issues
> persist. Having a sniffer capture of the problem with known keys (!)
> would be useful though.
>

The submitter seems to say he sees the new key with old PN in the air.
He attached sniffer captures with known keys. I guess that Wireshark
is able to try different keys and check which one is the one that
leads to a successful decryption.
https://bugzilla.kernel.org/show_bug.cgi?id=92451#c14

I can indeed see that the PN is going back to one way after the EAPOL
frame exchange is finished.
Note that Windows doesn't seem to be suffering from this problem
(again - based on what the user said).
So basically, the sender is not behaving nice. It bumps the PN of the
new key. If the sender would have kept using the old key for a while
and change the IV and the key atomically, we would have been fine. We
would have dropped the packets until the sender finally uses the new
key, and this would not have bumped the PN of the new key. The problem
(IMHO) is that the sender use the *new* key which means that there is
no decryption failure with the old PN. And only later the PN goes back
to 1. I don't know how we can possibly work around this. And just like
the user is saying, I wonder how Windows doesn't suffer from the same
problem as mac80211...

>
>> AFAIK, the PTK is installed immediately after the 4th message is sent
>> without waiting to ACK or any other delay. As the AP (should) installs
>> the keys only after processing the 4th message, so a delay is
>> expected.
>
> Makes sense.
>
> johannes
>

  reply	other threads:[~2015-05-18 19:34 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
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 [this message]
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=CANUX_P1gfcq9_qiZSDwqNzu2PCcw-DEfu7JkSHZqb8UHmyWU8g@mail.gmail.com \
    --to=egrumbach@gmail.com \
    --cc=alexander.wetzel@web.de \
    --cc=ilan.peer@intel.com \
    --cc=j@w1.fi \
    --cc=johannes@sipsolutions.net \
    --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).