linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masashi Honma <masashi.honma@gmail.com>
To: Jouni Malinen <j@w1.fi>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: Encrypt "Group addressed privacy" action frames
Date: Wed, 22 Jun 2016 19:54:10 +0900	[thread overview]
Message-ID: <576A6E52.1050705@gmail.com> (raw)
In-Reply-To: <20160621170120.GA24882@w1.fi>


On 2016年06月22日 02:01, Jouni Malinen wrote:
> Please keep in mind that "working" here means two things:
> (1) being able decrypt the frame,
> (2) being able to reject the frame if it was not properly protected. It
> is that (2) that is unlikely to be covered here..
>
> We actually cover (2) for some cases by "accident" since
> ieee80211_rx_h_decrypt() assigns rx->key to rx->sta->gtk[i] if one is
> available. I'm not completely sure this is correct since it applies to
> management frame as well, but that's the way commit
> 897bed8b4320774e56f282cdc1cceb4d77442797 ('mac80211: clean up RX key
> checks') implemented it (Johannes: Could you please take a look whether
> that gtk[] case was really supposed to apply for non-Data frames?).
> Interestingly, even on the TX side, we had code that picked tx->key for
> these group addressed Action frames, but that got then cleared later..
>
> That said, if rx->sta->gtk[i] is not set for any value of i, we would
> not enforce encryption of "group addressed privacy" Action frames as far
> as I can tell. This may be a pretty small window since RX MGTK is
> supposed to get set immediately for each peer. However, I would not be
> surprised if there were indeed a window between adding the STA entry and
> marking it authorized and configuring the RX MGTK. And even if this is
> not possible, this should really be commented somewhere so that there is
> less of a change of accidentally optimizing or cleaning up something
> that is needed for this to be protected..
>
> And when operating with PMF enabled, this is clearly broken, i.e., the
> RX path accepts BIP protected version of the broadcast Mesh Action frame
> while that frame needs to be rejected since it was not encrypted with
> CCMP/GCMP.
>
> To cover all these RX cases properly, I'd expect there to be RX path
> changes that use ieee80211_is_group_privacy_action() and reject some
> cases.. This should like be there in the !ieee80211_has_protected(fc)
> case in ieee80211_rx_h_decrypt() before selecting the key and if
> ieee80211_is_group_privacy_action() returns true, return RX_DROP_MONITOR
> would be needed.
>
Thank you Jouni and Johannes.

Indeed, received unencrypted Group Addressed Privacy action frame is 
dropped at
below if condition in ieee80211_drop_unencrypted_mgmt().
     /* BIP does not use Protected field, so need to check MMIE */
     if (unlikely(ieee80211_is_multicast_robust_mgmt_frame(rx->skb) &&
              ieee80211_get_mmie_keyidx(rx->skb) < 0)) {
         if (ieee80211_is_deauth(fc) ||
             ieee80211_is_disassoc(fc))
             cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev,
                              rx->skb->data,
                              rx->skb->len);
         return -EACCES;
     }
Because the frame was not encrypted and does not have MMIE.

And there could be one more case. Group Addressed Privacy action frame 
could have
robustness by MMIC because of previous wrong implementation. The frame could
not be cought by ieee80211_drop_unencrypted_mgmt(). Because the frame 
has MMIE.
So I have added new condition to ieee80211_rx_h_decrypt() by follwing patch.



  parent reply	other threads:[~2016-06-22 10:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  5:38 [PATCH] mac80211: Encrypt "Group addressed privacy" action frames Masashi Honma
2016-06-18  9:11 ` Jouni Malinen
2016-06-20  0:51   ` Masashi Honma
2016-06-20 21:25     ` Jouni Malinen
2016-06-21  6:16       ` Masashi Honma
2016-06-21 17:01         ` Jouni Malinen
2016-06-21 19:40           ` Johannes Berg
2016-06-22 10:54           ` Masashi Honma [this message]
2016-06-22 10:55           ` [PATCH v3] " Masashi Honma
2016-06-29 15:08             ` Masashi Honma
2016-06-29 16:25               ` Johannes Berg
2016-06-29 23:20                 ` Masashi Honma
2016-06-21  6:23       ` [PATCH v2] " Masashi Honma
2016-06-21 16:42         ` Jouni Malinen
2016-06-22 10:53           ` Masashi Honma

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=576A6E52.1050705@gmail.com \
    --to=masashi.honma@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).