nl80211/cfg80211: Add support for drivers with AP SME that require PMF SA Query assistance
Johannes,
Thanks for your comments regarding these changes. See my responses below.
- Chet
Quoted 2 lines · Chet Lanctot
Quoted 1 line
This adds support for drivers that have AP SME integrated but do not
implement the SA Query procedure that is part of Protected
Quoted 2 lines
Quoted 2 lines
Management Frames (PMF, 802.11w).
Instead, hostapd can be used to assist drivers that lack SA Query
Procedure handling on their own by allowing them to specify this as a device capability flag.
Quoted 1 line
Quoted 1 line
Also, a station flag is added to let hostapd indicate to the driver
that the SA Query procedure is complete and the driver can process association requests from the station normally.
Quoted 1 line
How will this work? If the device is processing the auth/assoc request
frames, then how can hostapd know this? Is the device expected to then pass up the frame?
Yes, the device will detect the case of an unprotected Assoc Request from a station where there is already a PMF connection and, in this case, will pass up the frame to hostapd. hostapd already has code to handle this case and will initiate the SA Query procedure. This has been tested and it works correctly.
The station flag is added for hostapd to signal back to the device that SA Query has timed out (completed) and that the device should process Assoc Request frames from that station normally.
Quoted 1 line
Also, which (upstream) driver is going to use this?
These changes are of general utility for any device that implements AP SME and will also implement PMF. We will be up-steaming a driver that will use these extensions in the future.
Quoted 1 line
Quoted 1 line
+ * @NL80211_ATTR_AP_SME_NO_SA_QUERY: The driver for this device +
* implments the AP SME but lacks support for doing the MFP SA
Quoted 1 line
typo: implements
I will fix this typo.
Quoted 1 line
Quoted 1 line
+ * Query procedure. This flag is used to express the need for + * a
userspace helper (hostapd) to do this procedure and notifiy
Quoted 1 line
typo: notify
I will fix this typo.
Quoted 2 lines
Quoted 1 line
+ * the driver through cfg80211 when it is complete.
Should probably say how the driver is notified (via the station flag)?
I will clarify this comment.
Quoted 1 line
Review int cfg80211_check_station_change(struct wiphy
Quoted 1 line
(quoted diff) +0
-0@@ -3689,7 +3689,7 @@ int cfg80211_check_station_change(struct wiphy
*wiphy,
Quoted 7 lines
Review int cfg80211_check_station_change(struct wiphy
Quoted 7 lines
(quoted diff) +1
-1return -EINVAL; /* When you run into this, adjust the code below for the new flag */ - BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 7); + BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 8); switch (statype) { case CFG80211_STA_MESH_PEER_KERNEL:@@ -3766,7 +3766,8 @@ int cfg80211_check_station_change(struct wiphy
*wiphy,
Quoted 9 lines
Review int cfg80211_check_station_change(struct wiphy · line 3772
Quoted 8 lines
(quoted diff) +2
-1BIT(NL80211_STA_FLAG_ASSOCIATED) | BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) | BIT(NL80211_STA_FLAG_WME) | - BIT(NL80211_STA_FLAG_MFP))) + BIT(NL80211_STA_FLAG_MFP) | + BIT(NL80211_STA_FLAG_NO_SA_QUERY_REQUIRED))) return -EINVAL; /* but authenticated/associated only if driver handles it */Maybe we should also check if the driver supports the flag?
For existing PMF (MFP) code, there is no check for driver support of PMF. wpa_supplicant and hostapd just pass PMF information to the driver. The driver just ignores the information if it does not support PMF.
Quoted 1 line
Review static int nl80211_new_station(struct sk_buff
Quoted 1 line
(quoted diff) +0
-0@@ -4090,7 +4091,7 @@ static int nl80211_new_station(struct sk_buff
*skb, struct genl_info *info)
Quoted 7 lines
Review static int nl80211_new_station(struct sk_buff · line 4095
Quoted 6 lines
(quoted diff) +1
-1return -EINVAL; /* When you run into this, adjust the code below for the new flag */ - BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 7); + BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 8); switch (dev->ieee80211_ptr->iftype) { case NL80211_IFTYPE_AP:Can this really be right? Is it simply invalid on a new station? Why
does this even make sense - this is done for AP SME where this is never invoked?
Quoted 1 line
Anyway you need to reject adding TDLS peers with this flag, for example,
afaict.
The idea here was that this new flag is used to signal a state transition for stations for which the SA Query procedure has already started. So, yes, it is invalid for a “new station” operation.
But when the driver detects that an SA Query procedure is needed for an associated station, it passes the Association Request up to hostapd and remembers that the SA Query is in progress for that station.
This new flag allows hostapd to signal to the driver that SA Query has completed and the driver can clear the state for that station indicating that SA Query is in progress. So this flag is only used in the “station change” operation.
Perhaps there is a cleaner way to do this? What we are trying to accomplish is to allow hostapd to signal to the driver that SA Query has completed and do this using an already existing nl80211/cfg80211 interface (and just adding a new flag).
Quoted 1 line
johannes
Quoted 3 lines · On Fri, 2014-01-03 at 21:30 +0000, [email protected] wrote:
Johannes,
Thanks for your comments regarding these changes. See my responses below.
Your responses are practically impossible to read in this interleaving with my notes. Care to resend with proper quote marks?
johannes
[please fix your quoting. I'll reply anyway this time, but still, it's odd to read if you get linebreaks but the quote marks only apply to the first line]
Quoted 5 lines · On Fri, 2014-01-03 at 21:30 +0000, [email protected] wrote:
Yes, the device will detect the case of an unprotected Assoc Request from a station where there is already a PMF connection and, in this case, will pass up the frame to hostapd. hostapd already has code to handle this case and will initiate the SA Query procedure. This has been tested and it works correctly.
Documentation needed then.
Quoted 3 lines
The station flag is added for hostapd to signal back to the device that SA Query has timed out (completed) and that the device should process Assoc Request frames from that station normally.
Seems reasonable I guess.
Quoted 4 lines
Quoted 1 line
Also, which (upstream) driver is going to use this?
These changes are of general utility for any device that implements AP SME and will also implement PMF. We will be up-steaming a driver that will use these extensions in the future.
I'm curious, for what device? :)
Quoted 3 lines
For existing PMF (MFP) code, there is no check for driver support of PMF.
wpa_supplicantand hostapd just pass PMF information to the driver. The driver just ignores the information if it does not support PMF.
Really? But anyway the driver might be confused if it sees a station change with something changing that doesn't actually do anything for it?
Quoted 9 lines
Quoted 1 line
Review static int nl80211_new_station(struct sk_buff
Quoted 1 line
(quoted diff) +0
-0@@ -4090,7 +4091,7 @@ static int nl80211_new_station(struct sk_buff*skb, struct
genl_info*info)Quoted 7 lines
Review static int nl80211_new_station(struct sk_buff · line 4095
Quoted 6 lines
(quoted diff) +1
-1return -EINVAL; /* When you run into this, adjust the code below for the new flag */ - BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 7); + BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 8); switch (dev->ieee80211_ptr->iftype) { case NL80211_IFTYPE_AP:Can this really be right? Is it simply invalid on a new station? Why
Quoted 7 lines
does this even make sense - this is done for AP SME where this is never invoked?
Quoted 1 line
Anyway you need to reject adding TDLS peers with this flag, for example,
afaict.
The idea here was that this new flag is used to signal a state transition for stations for which the SA Query procedure has already started. So, yes, it is invalid for a “new station” operation.
Right, so then you should just reject it there? New station is never even called for AP SME, I believe, so it wouldn't make sense at all to specify the flag.
Quoted 8 lines
But when the driver detects that an SA Query procedure is needed for an associated station, it passes the Association Request up to hostapd and remembers that the SA Query is in progress for that station.
This new flag allows hostapd to signal to the driver that SA Query has completed and the driver can clear the state for that station indicating that SA Query is in progress. So this flag is only used in the “station change” operation.
Yeah, I get that.
Quoted 4 lines
Perhaps there is a cleaner way to do this? What we are trying to accomplish is to allow hostapd to signal to the driver that SA Query has completed and do this using an already existing nl80211/cfg80211 interface (and just adding a new flag).
I think that's OK, but you're adding it in a way that allows the flag to be used with other operations and that'd be inconsistent with the flag semantics, it seems?
johannes