linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jouni Malinen <j@w1.fi>
Cc: Emmanuel Grumbach <egrumbach@gmail.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: mac80211 drops packet with old IV after rekeying
Date: Sun, 17 May 2015 21:14:53 +0200	[thread overview]
Message-ID: <1431890093.2129.4.camel@sipsolutions.net> (raw)
In-Reply-To: <20150517160513.GA13175@w1.fi>

On Sun, 2015-05-17 at 19:05 +0300, Jouni Malinen wrote:
> On Sat, May 16, 2015 at 09:57:09PM +0200, Johannes Berg wrote:
> > 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.
> 
> It was added in IEEE Std 802.11-2012. Search for Extended Key ID for
> Individually Addressed Frames subfield of the RSN Capabilities field (a
> field within RSN element).

Ah, I had searched for (very briefly) for key IV things but hadn't found
it. Good to know.

> I'm not sure whether anyone has implemented this, but anyway, we could
> relatively easily add support for this with mac80211 + hostapd +
> wpa_supplicant combination. Though, probably that would end up depending
> on a new driver capability flag, so only with some drivers.

Indeed, although for most drivers it could be implemented using SW
crypto in the transition period. Then again, the old key would probably
stick around for quite a while (practically forever, until the next
rekey) so that's not a good idea.

I guess we should consider that. I believe our device would support HW
crypto in this scenario as well, although I'm not completely sure and
would obviously have to test it.

> I did not look at the details of the reported issue. Was this an issue
> in a received frame with old key being processed by mac80211 after key
> change and while doing that, ending up configuring incorrect (way too
> large) RX PN for the new key?

Yes.

> Dropping the frames with the old key would be one option, but not really
> ideal. A somewhat nicer option would be to add a concept of generation
> to the key (i.e., the 1st, 2nd, ... key using key index N) and with the
> help of drivers (that can do this), indicate which generation of the key
> was used for RX decryption. This would allow proper replay protection
> for both keys if we were to store copies of the RX counters for both the
> previous and current key in mac80211.

That would be good, but I can't think of any driver that'd be able to
implement it. In software crypto we could (theoretically) try both keys,
i.e. structure the transition as having both keys valid in software, and
switch over once decrypting with the old one fails and succeeds with the
new one. However, that seems like a lot of effort for very little gain.

johannes


      parent reply	other threads:[~2015-05-17 19:14 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
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             ` Johannes Berg [this message]

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=1431890093.2129.4.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=egrumbach@gmail.com \
    --cc=j@w1.fi \
    --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).