01The symptom
Joining any WPA3-only network took the phone down. WPA2 networks on the same router worked. I found the cause without a crash log, by reading the binaries.
02Why only WPA3
With WPA3 (SAE), wpa_supplicant runs the authentication in userspace and hands the result to the driver with NL80211_CMD_EXTERNAL_AUTH. The kernel then calls the driver's external_auth op. WPA2 never takes that path: the ops it uses, like connect and auth, sit lower in the table, where nothing had moved.
03The 8 bytes
On this phone the Wi-Fi driver isn't built with the kernel. It's the vendor's prebuilt module, compiled against their 4.14.141 kernel, and force-loaded into the custom one. The custom kernel had picked up a stable backport that adds a new op, end_cac, right after start_radar_detection. Every op after it moved down by 8 bytes.
ops->external_auth at offset 824. The module's table is only 824 bytes long, so that slot is the first value after it: a pointer to a string, apucCorDumpN9FileName. The CPU jumps into text.That's the whole bug. The kernel and the driver agreed on everything below offset 664, which is why WPA2 kept working, and disagreed on everything above it.
04The fix
I took end_cac back out of cfg80211 and mac80211, along with the code that used it, so the table matches what the driver was built against. Then I pinned the layout, so a future backport that moves anything fails the build instead of crashing a phone:
/* net/wireless/core.c, in wiphy_new_nm() */ BUILD_BUG_ON(offsetof(struct cfg80211_ops, start_radar_detection) != 656); BUILD_BUG_ON(offsetof(struct cfg80211_ops, update_ft_ies) != 664); BUILD_BUG_ON(offsetof(struct cfg80211_ops, external_auth) != 816); BUILD_BUG_ON(sizeof(struct cfg80211_ops) != 824);
05Checking it
- pahole on the new vmlinux shows external_auth at 816 and the table at 824 bytes, matching the module.
- On the phone, it joined a WPA3-only network with SAE and PMF, the handshake completed, and dmesg stayed clean.
- All the extra Wi-Fi modules were rebuilt against the new kernel, so nothing else drifted.
06Shipping it
The fix went out as v1.2 on GitHub. I updated my Kali NetHunter merge request, !470, with it, and Kali merged it on 2 December 2026. Later I checked the other RMX2020 ROMs. Only the Android 13-era builds load the prebuilt module, and newer ROMs build the Wi-Fi driver from source, so they were never exposed.
When a kernel loads a binary-only module, the struct layout is an ABI. A stable backport can break it silently. A few compile-time checks are cheap insurance.
The lesson I keep