Gd32vw553 wpa3 reject#19461
Open
JorgeGzm wants to merge 2 commits into
Open
Conversation
Associating to a WPA3 (SAE) network faulted inside the prebuilt vendor supplicant (load access fault in the elliptic-curve math of the SAE handshake, wifi_mgmt task). The port is WPA2-only, so refuse what the supplicant cannot complete: - Undefine CONFIG_WPA3_SAE in the build_config.h shim. This activates the vendor's own fallback in wifi_netlink.c: the SAE/OWE AKMs are stripped from the connection config and the SAE auth algorithm is never selected, so a WPA3-transition AP (WPA2/WPA3 mixed) now associates through WPA2-PSK. The flag only gates code, not struct layout, so the prebuilt libraries are unaffected. - Refuse an SAE/OWE/802.1X-only network up front in the connect path with ENOTSUP and a console message naming the unsupported AKM bitmap, instead of an obscure association failure. Validated on hardware (GD32VW553K-START), all three cases: a WPA2 network still associates (four-way handshake, DHCP, ping); a WPA2/WPA3 transition hotspot ([RSN:WPA-PSK,SAE CCMP/CCMP][MFP]) associates through WPA2-PSK, gets a lease and pings the gateway (it crashed before this change); and a WPA3-only hotspot is now refused with gdwifi: 'wpa3test' offers no supported AKM (bitmap 0x200): WPA3/SAE, OWE and 802.1X are not supported, WPA2-PSK only where it previously crashed. Assisted-by: Claude Opus 4.8 Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
A connection stops the legacy advertising set and the vendor stack leaves it stopped, so after the first central connected (or aborted the attempt) the device was never discoverable again until a reset. Register a connection callback and restart the advertising set with ble_adv_restart() on every disconnection event. This covers both the clean disconnect and the aborted-connection case: an incomplete connection holds the (single) link until the supervision timeout, and its disconnection event then restarts the advertising the same way. Validated on hardware (GD32VW553K-START): repeated scan/connect/write/disconnect cycles from a Linux central all find the device advertising again after the previous cycle, where it previously required a reset after the first connection. Assisted-by: Claude Opus 4.8 Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
acassis
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two robustness fixes for the GD32VW553 port:
1. Reject WPA3/SAE networks instead of crashing. Associating to a WPA3
(SAE) network faulted inside the prebuilt vendor supplicant (load access
fault in the elliptic-curve math of the SAE handshake). The port is
WPA2-only, so refuse what the supplicant cannot complete:
CONFIG_WPA3_SAEin thebuild_config.hshim. This activatesthe vendor's own fallback in
wifi_netlink.c: the SAE/OWE AKMs arestripped from the connection config and the SAE auth algorithm is never
selected, so a WPA3-transition AP (WPA2/WPA3 mixed) now associates
through WPA2-PSK. The flag only gates code, not struct layout, so the
prebuilt libraries are unaffected.
ENOTSUPand a console message naming the unsupported AKM bitmap,instead of an obscure association failure.
2. Restart BLE advertising after disconnection. A connection stops the
legacy advertising set and the vendor stack leaves it stopped, so after the
first central connected (or aborted the attempt) the device was never
discoverable again until a reset. Register a connection callback and
restart the advertising set with
ble_adv_restart()on everydisconnection. This covers both the clean disconnect and the
aborted-connection case (an incomplete connection holds the link until the
supervision timeout, whose disconnection event then restarts the
advertising the same way).
Impact
Only the GD32VW55x port (
arch/risc-v/src/gd32vw55xand its boarddocumentation); no common code is changed. Behavior changes:
crashed the supplicant).
ENOTSUPand a clear consolemessage (it previously crashed the supplicant).
required a reset after the first connection).
Testing
Built the
wapiandbleconfigurations;nxstyleis clean. Validatedon hardware (GD32VW553K-START).
1. WPA2 network (regression: still associates)
2. WPA3(SAE)-only network: refused with a clear error, no crash
Phone hotspot
wpa3testconfigured as WPA3-Personal (SAE only):(Before this change:
EXCEPTION: Load access faultin thewifi_mgmttask.
0x200is bit 9 =MAC_AKM_SAE. A refused connect also leaves apreviously established association untouched.)
3. WPA2/WPA3 transition network: associates through WPA2-PSK
Same hotspot switched to WPA2/WPA3 mixed mode; note the SAE AKM and MFP in
the beacon, and the plain WPA2 four-way handshake used:
(Before this change this case also crashed: the supplicant selected SAE
whenever the AP offered it.)
4. BLE: repeated connect cycles from a Linux central (bleak)
Scan / connect / write / disconnect cycles, no board reset in between:
Board console receives the writes:
(Before this change the device was no longer advertising after the first
connection and never became discoverable again until a reset.)