Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: wfx: repair open network AP mode
@ 2024-08-23 13:15 A. Sverdlin
  2024-08-23 13:42 ` Sverdlin, Alexander
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: A. Sverdlin @ 2024-08-23 13:15 UTC (permalink / raw)
  To: linux-wireless
  Cc: Alexander Sverdlin, Jérôme Pouiller, Kalle Valo,
	Dmitry Antipov, stable

From: Alexander Sverdlin <alexander.sverdlin@siemens.com>

RSN IE missing in beacon is normal in open networks.
Avoid returning -ENODEV in this case.

Steps to reproduce:

$ cat /etc/wpa_supplicant.conf
network={
	ssid="testNet"
	mode=2
	key_mgmt=NONE
}

$ wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf
nl80211: Beacon set failed: -22 (Invalid argument)
Failed to set beacon parameters
Interface initialization failed
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED
wlan0: Unable to setup interface.
Failed to initialize AP interface

After the change:

$ wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED

Cc: stable@vger.kernel.org
Fixes: fe0a7776d4d1 ("wifi: wfx: fix possible NULL pointer dereference in wfx_set_mfp_ap()")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
---
 drivers/net/wireless/silabs/wfx/sta.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c
index 216d43c8bd6e..7c04810dbf3d 100644
--- a/drivers/net/wireless/silabs/wfx/sta.c
+++ b/drivers/net/wireless/silabs/wfx/sta.c
@@ -352,8 +352,11 @@ static int wfx_set_mfp_ap(struct wfx_vif *wvif)
 
 	ptr = (u16 *)cfg80211_find_ie(WLAN_EID_RSN, skb->data + ieoffset,
 				      skb->len - ieoffset);
-	if (unlikely(!ptr))
+	if (!ptr) {
+		/* No RSN IE is fine in open networks */
+		ret = 0;
 		goto free_skb;
+	}
 
 	ptr += pairwise_cipher_suite_count_offset;
 	if (WARN_ON(ptr > (u16 *)skb_tail_pointer(skb)))
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-27  7:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 13:15 [PATCH] wifi: wfx: repair open network AP mode A. Sverdlin
2024-08-23 13:42 ` Sverdlin, Alexander
2024-08-23 14:59   ` Kalle Valo
2024-08-23 15:07 ` Kalle Valo
2024-08-23 15:14   ` Sverdlin, Alexander
2024-08-26 15:12 ` Jérôme Pouiller
2024-08-26 15:42   ` Sverdlin, Alexander
2024-08-26 18:53     ` Jérôme Pouiller
2024-08-27  7:49 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox