[0/2] wifi: nl80211/wilc1000: force WLAN_AKM_SUITE_SAE to big endian in NL80211_CMD_EXTERNAL_AUTH

Message ID 20240215-nl80211_fix_akm_suites_endianness-v1-0-57e902632f9d@bootlin.com
Headers
Series wifi: nl80211/wilc1000: force WLAN_AKM_SUITE_SAE to big endian in NL80211_CMD_EXTERNAL_AUTH |

Message

Alexis Lothoré Feb. 15, 2024, 2:13 p.m. UTC
  This small series is the follow-up to discussions started around a sparse
warning in wilc1000 driver ([1]) and implements the solution suggested by
Johannes. It moves a historically needed conversion to be32 in nl80211 (in
NL80211_CMD_EXTERNAL_AUTH, specifically on NL80211_ATTR_AKM_SUITES property
_only_ when it is set to WLAN_AKM_SUITE_SAE) The user scenario affected by
this update is a connect process on a WPA3-protected access point with
authentication offloaded to user-space. Two drivers are affected by the
update: wilc1000 and qtnfmac. wilc1000 case is handled by a small
companion patch which also fixes the sparse warning.

For the quantenna driver, I don't really get how it manipulates AKM suites.
The only thing it currently does on it before calling nl80211 is a
le32_to_cpu. IIUC the raw value (before applying le32_to_cpu) comes from
chip/firmware:
<interrupt>
 qtnf_shm_ipc_irq_handler
  <some callbacks chains>
   qtnf_pcie_control_rx_callback
    qtnf_trans_handle_rx_ctl_packet
     qtnf_trans_event_enqueue => queue skb to processing queue

qtnf_event_work_handler <= dequeue corresponding skb to process
 qtnf_event_process_skb
  qtnf_event_parse
   qtnf_event_handle_external_auth
    cfg80211_external_auth_request => sends NL80211_CMD_EXTERNAL_AUTH

There is no cast to big endian on AKM suite at any point in this chain, but
there are plenty of leXX_to_cpu, so I assume the chip/its firmware sends
its data in little endian. Then, since the be32 conversion is _needed_ with
current wpa_supplicant, I wonder if it works at all in current state, so I
did not modify it. Or has it been tested with another supplicant (iwd ?)
which handles WLAN_AKM_SUITE_SAE differently ? Opinions (and even some
testing) are welcome for this driver, since I do not have the corresponding
hardware.

[1] https://lore.kernel.org/linux-wireless/87a5uatfl1.fsf@kernel.org/

To: Johannes Berg <johannes@sipsolutions.net>
Cc: Ajay Singh <ajay.kathat@microchip.com>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: <linux-wireless@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Cc: Igor Mitsyanko <imitsyanko@quantenna.com>
Cc: Sergey Matyukevich <geomatsi@gmail.com>

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
Alexis Lothoré (2):
      wifi: nl80211: force WLAN_AKM_SUITE_SAE in big endian in NL80211_CMD_EXTERNAL_AUTH
      wifi: wilc1000: remove AKM suite be32 conversion for external auth request

 drivers/net/wireless/microchip/wilc1000/cfg80211.c |  2 +-
 net/wireless/nl80211.c                             | 19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)
---
base-commit: a4c7842e88b0f7d937015e4588ea2a1dec33cf2c
change-id: 20240214-nl80211_fix_akm_suites_endianness-2750a5d7da83

Best regards,
  

Comments

Alexis Lothoré Feb. 15, 2024, 3:50 p.m. UTC | #1
On 2/15/24 15:13, Alexis Lothoré wrote:
> This small series is the follow-up to discussions started around a sparse
> warning in wilc1000 driver ([1]) and implements the solution suggested by
> Johannes. It moves a historically needed conversion to be32 in nl80211 (in
> NL80211_CMD_EXTERNAL_AUTH, specifically on NL80211_ATTR_AKM_SUITES property
> _only_ when it is set to WLAN_AKM_SUITE_SAE) The user scenario affected by
> this update is a connect process on a WPA3-protected access point with
> authentication offloaded to user-space. Two drivers are affected by the
> update: wilc1000 and qtnfmac. wilc1000 case is handled by a small
> companion patch which also fixes the sparse warning.

Adding Claudio Beznea (co-maintainer for WILC), who got lost when I prepared the
series, sorry.

Also, my mail provider returns error 550 (No Such User Here) for quantenna
driver maintainer (<imitsyanko@quantenna.com>, taken from MAINTAINERS). I've
seen no recent activity from him on the ML, is he still around ?
  
Kalle Valo Feb. 15, 2024, 5:06 p.m. UTC | #2
(changing subject)

Alexis Lothoré <alexis.lothore@bootlin.com> writes:

> Also, my mail provider returns error 550 (No Such User Here) for quantenna
> driver maintainer (<imitsyanko@quantenna.com>, taken from MAINTAINERS). I've
> seen no recent activity from him on the ML, is he still around ?

I found a bounce for imitsyanko@quantenna.com from 2022 so I guess it's
time to orphan qtnfmac?

Also the purelife maintainer Srini Raju (CCed) is bouncing, that's
another candidate to orphan.

PURELIFI PLFXLC DRIVER
M:      Srinivasan Raju <srini.raju@purelifi.com>
L:      linux-wireless@vger.kernel.org
S:      Supported
F:      drivers/net/wireless/purelifi/plfxlc/