diff mbox series

[v1] check for FT support when selecting FT suites

Message ID 20200204011204.2912-1-matthewmwang@chromium.org
State Accepted
Headers show
Series [v1] check for FT support when selecting FT suites | expand

Commit Message

Matthew Wang Feb. 4, 2020, 1:12 a.m. UTC
A driver supports FT if it either supports SME or the
NL80211_CMD_UPDATE_FT_IES command. When selecting AKM suites,
wpa_supplicant currently doesn't take into account whether or not either
of those conditions are met. This can cause association failures e.g. when
an AP supports both WPA-EAP and FT-EAP but the driver doesn't support FT
(supplicant will decide to do FT-EAP since it is unaware the driver
doesn't support it). This change allows an FT suite to be selected only
when the driver also supports FT.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
---
 src/drivers/driver.h              | 2 ++
 src/drivers/driver_nl80211_capa.c | 7 +++++++
 wpa_supplicant/wpa_supplicant.c   | 4 ++++
 3 files changed, 13 insertions(+)

Comments

Brian Norris Feb. 4, 2020, 1:17 a.m. UTC | #1
On Mon, Feb 3, 2020 at 5:16 PM Matthew Wang <matthewmwang@chromium.org> wrote:
>
> A driver supports FT if it either supports SME or the
> NL80211_CMD_UPDATE_FT_IES command. When selecting AKM suites,
> wpa_supplicant currently doesn't take into account whether or not either
> of those conditions are met. This can cause association failures e.g. when
> an AP supports both WPA-EAP and FT-EAP but the driver doesn't support FT
> (supplicant will decide to do FT-EAP since it is unaware the driver
> doesn't support it). This change allows an FT suite to be selected only
> when the driver also supports FT.
>
> Signed-off-by: Matthew Wang <matthewmwang@chromium.org>

Reviewed-by: Brian Norris <briannorris@chromium.org>
Matthew Wang Feb. 4, 2020, 10:50 p.m. UTC | #2
Yes, certainly possible. From your logs, it looks like you have a
non-SME driver. If your driver also doesn't support UPDATE_FT_IES,
then it's likely this will fix your problem.


On Tue, Feb 4, 2020 at 12:35 AM Matteo Fortini <matteo.fortini@gmail.com> wrote:
>
> Hi, could this be the fix to
> https://www.spinics.net/lists/hostap/msg06607.html
> Thank you
>
>
> Il 04/02/20 02:12, Matthew Wang ha scritto:
>
> A driver supports FT if it either supports SME or the
> NL80211_CMD_UPDATE_FT_IES command. When selecting AKM suites,
> wpa_supplicant currently doesn't take into account whether or not either
> of those conditions are met. This can cause association failures e.g. when
> an AP supports both WPA-EAP and FT-EAP but the driver doesn't support FT
> (supplicant will decide to do FT-EAP since it is unaware the driver
> doesn't support it). This change allows an FT suite to be selected only
> when the driver also supports FT.
>
> Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
> ---
>  src/drivers/driver.h              | 2 ++
>  src/drivers/driver_nl80211_capa.c | 7 +++++++
>  wpa_supplicant/wpa_supplicant.c   | 4 ++++
>  3 files changed, 13 insertions(+)
>
> diff --git a/src/drivers/driver.h b/src/drivers/driver.h
> index 9bdf88011..601b3e24c 100644
> --- a/src/drivers/driver.h
> +++ b/src/drivers/driver.h
> @@ -1823,6 +1823,8 @@ struct wpa_driver_capa {
>  #define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL
>  /** Driver supports VLAN offload */
>  #define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL
> +/** Driver supports UPDATE_FT_IES command */
> +#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL
>   u64 flags;
>
>  #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
> diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
> index 31e7cbfe5..6968e8e2a 100644
> --- a/src/drivers/driver_nl80211_capa.c
> +++ b/src/drivers/driver_nl80211_capa.c
> @@ -78,6 +78,7 @@ struct wiphy_info_data {
>   unsigned int wmm_ac_supported:1;
>   unsigned int mac_addr_rand_scan_supported:1;
>   unsigned int mac_addr_rand_sched_scan_supported:1;
> + unsigned int update_ft_ies_supported:1;
>  };
>
>
> @@ -243,6 +244,9 @@ static void wiphy_info_supp_cmds(struct wiphy_info_data *info,
>   case NL80211_CMD_SET_QOS_MAP:
>   info->set_qos_map_supported = 1;
>   break;
> + case NL80211_CMD_UPDATE_FT_IES:
> + info->update_ft_ies_supported = 1;
> + break;
>   }
>   }
>  }
> @@ -912,6 +916,9 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
>   drv->capa.max_sched_scan_plan_iterations = 0;
>   }
>
> + if (info->update_ft_ies_supported)
> + drv->capa.flags |= WPA_DRIVER_FLAGS_UPDATE_FT_IES;
> +
>   return 0;
>  }
>
> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> index aa7e1d09a..911727e05 100644
> --- a/wpa_supplicant/wpa_supplicant.c
> +++ b/wpa_supplicant/wpa_supplicant.c
> @@ -1458,6 +1458,10 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
>   if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE))
>   sel &= ~(WPA_KEY_MGMT_SAE | WPA_KEY_MGMT_FT_SAE);
>  #endif /* CONFIG_SAE */
> +#ifdef CONFIG_IEEE80211R
> + if (!(wpa_s->drv_flags & (WPA_DRIVER_FLAGS_SME | WPA_DRIVER_FLAGS_UPDATE_FT_IES)))
> + sel &= ~WPA_KEY_MGMT_FT;
> +#endif /* CONFIG_IEEE80211R */
>   if (0) {
>  #ifdef CONFIG_IEEE80211R
>  #ifdef CONFIG_SHA384
>
>
Brian Norris Feb. 4, 2020, 11:01 p.m. UTC | #3
Hi,

On Tue, Feb 4, 2020 at 2:50 PM Matthew Wang <matthewmwang@chromium.org> wrote:
> Yes, certainly possible. From your logs, it looks like you have a
> non-SME driver. If your driver also doesn't support UPDATE_FT_IES,
> then it's likely this will fix your problem.
>
> On Tue, Feb 4, 2020 at 12:35 AM Matteo Fortini <matteo.fortini@gmail.com> wrote:
> >
> > Hi, could this be the fix to
> > https://www.spinics.net/lists/hostap/msg06607.html
> > Thank you

Looks like you're using brcmfmac:

https://www.spinics.net/lists/hostap/msg06606.html

and so are the Arch Linux reporters:

https://bugs.archlinux.org/task/63397

That driver does not support UDATE_FT_IES, and so I believe yes, this
patch should fix that.

Brian
Jouni Malinen Feb. 10, 2020, 5:28 a.m. UTC | #4
On Mon, Feb 03, 2020 at 05:12:05PM -0800, Matthew Wang wrote:
> A driver supports FT if it either supports SME or the
> NL80211_CMD_UPDATE_FT_IES command. When selecting AKM suites,
> wpa_supplicant currently doesn't take into account whether or not either
> of those conditions are met. This can cause association failures e.g. when
> an AP supports both WPA-EAP and FT-EAP but the driver doesn't support FT
> (supplicant will decide to do FT-EAP since it is unaware the driver
> doesn't support it). This change allows an FT suite to be selected only
> when the driver also supports FT.

Thanks, applied.
Matteo Fortini Feb. 10, 2020, 9:25 a.m. UTC | #5
I can confirm that the issue is fixed by this patch. Thank you @Matthew Wang

Il 05/02/20 00:01, Brian Norris ha scritto:
> Hi,
>
> On Tue, Feb 4, 2020 at 2:50 PM Matthew Wang <matthewmwang@chromium.org> wrote:
>> Yes, certainly possible. From your logs, it looks like you have a
>> non-SME driver. If your driver also doesn't support UPDATE_FT_IES,
>> then it's likely this will fix your problem.
>>
>> On Tue, Feb 4, 2020 at 12:35 AM Matteo Fortini <matteo.fortini@gmail.com> wrote:
>>> Hi, could this be the fix to
>>> https://www.spinics.net/lists/hostap/msg06607.html
>>> Thank you
> Looks like you're using brcmfmac:
>
> https://www.spinics.net/lists/hostap/msg06606.html
>
> and so are the Arch Linux reporters:
>
> https://bugs.archlinux.org/task/63397
>
> That driver does not support UDATE_FT_IES, and so I believe yes, this
> patch should fix that.
>
> Brian
diff mbox series

Patch

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 9bdf88011..601b3e24c 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1823,6 +1823,8 @@  struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_CONTROL_PORT		0x0400000000000000ULL
 /** Driver supports VLAN offload */
 #define WPA_DRIVER_FLAGS_VLAN_OFFLOAD		0x0800000000000000ULL
+/** Driver supports UPDATE_FT_IES command */
+#define WPA_DRIVER_FLAGS_UPDATE_FT_IES		0x1000000000000000ULL
 	u64 flags;
 
 #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 31e7cbfe5..6968e8e2a 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -78,6 +78,7 @@  struct wiphy_info_data {
 	unsigned int wmm_ac_supported:1;
 	unsigned int mac_addr_rand_scan_supported:1;
 	unsigned int mac_addr_rand_sched_scan_supported:1;
+	unsigned int update_ft_ies_supported:1;
 };
 
 
@@ -243,6 +244,9 @@  static void wiphy_info_supp_cmds(struct wiphy_info_data *info,
 		case NL80211_CMD_SET_QOS_MAP:
 			info->set_qos_map_supported = 1;
 			break;
+		case NL80211_CMD_UPDATE_FT_IES:
+			info->update_ft_ies_supported = 1;
+			break;
 		}
 	}
 }
@@ -912,6 +916,9 @@  static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
 		drv->capa.max_sched_scan_plan_iterations = 0;
 	}
 
+	if (info->update_ft_ies_supported)
+		drv->capa.flags |= WPA_DRIVER_FLAGS_UPDATE_FT_IES;
+
 	return 0;
 }
 
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index aa7e1d09a..911727e05 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1458,6 +1458,10 @@  int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
 	if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE))
 		sel &= ~(WPA_KEY_MGMT_SAE | WPA_KEY_MGMT_FT_SAE);
 #endif /* CONFIG_SAE */
+#ifdef CONFIG_IEEE80211R
+	if (!(wpa_s->drv_flags & (WPA_DRIVER_FLAGS_SME | WPA_DRIVER_FLAGS_UPDATE_FT_IES)))
+		sel &= ~WPA_KEY_MGMT_FT;
+#endif /* CONFIG_IEEE80211R */
 	if (0) {
 #ifdef CONFIG_IEEE80211R
 #ifdef CONFIG_SHA384