sonyxperiadev / bug_tracker

Empty repository that is used as a bugtracker for Open Devices project
52 stars 13 forks source link

[SEINE] Unable to connect to WiFi #825

Closed sudden6 closed 7 months ago

sudden6 commented 8 months ago

Platform: Seine Device: XQ-AU52 Kernel version: 13 Android version: Software binaries version:

Previously working on

No, has never worked for me.

Description

The device can't connect to a WiFi network, but it can list them. I think the relevant part of the log is:

01-23 00:47:08.180  4770  4770 D wpa_supplicant: wlan0: State: 4WAY_HANDSHAKE -> GROUP_HANDSHAKE
01-23 00:47:08.180  4770  4770 D wpa_supplicant: Notifying state change event to aidl control: 8
01-23 00:47:08.181  4770  4770 D wpa_supplicant: RSN: received GTK in pairwise handshake - hexdump(len=18): [REMOVED]
01-23 00:47:08.181  4770  4770 D wpa_supplicant: WPA: Group Key - hexdump(len=16): [REMOVED]
01-23 00:47:08.181  4770  4770 D wpa_supplicant: wlan0: WPA: Installing GTK to the driver (keyidx=2 tx=0 len=16)
01-23 00:47:08.182  4770  4770 D wpa_supplicant: WPA: RSC - hexdump(len=6): 5f 00 00 00 00 00
01-23 00:47:08.182  4770  4770 D wpa_supplicant: wpa_driver_nl80211_set_key: ifindex=30 (wlan0) alg=3 addr=0x59a067298a key_idx=2 set_tx=0 seq_len=6 key_len=16 key_flag=0x14
01-23 00:47:08.182  4770  4770 D wpa_supplicant: nl80211: NEW_KEY
01-23 00:47:08.183  4770  4770 D wpa_supplicant: nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
01-23 00:47:08.183  4770  4770 D wpa_supplicant: nl80211: KEY_SEQ - hexdump(len=6): 5f 00 00 00 00 00
01-23 00:47:08.183  4770  4770 D wpa_supplicant:    broadcast key
01-23 00:47:08.193  4770  4770 D wpa_supplicant: wlan0: WPA: IGTK keyid 5 pn 000000000000
01-23 00:47:08.193  4770  4770 D wpa_supplicant: WPA: IGTK - hexdump(len=16): [REMOVED]
01-23 00:47:08.193  4770  4770 D wpa_supplicant: wpa_driver_nl80211_set_key: ifindex=30 (wlan0) alg=4 addr=0x59a067298a key_idx=5 set_tx=0 seq_len=6 key_len=16 key_flag=0x14
01-23 00:47:08.194  4770  4770 D wpa_supplicant: nl80211: NEW_KEY
01-23 00:47:08.194  4770  4770 D wpa_supplicant: nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
01-23 00:47:08.195  4770  4770 D wpa_supplicant: nl80211: KEY_SEQ - hexdump(len=6): 00 00 00 00 00 00
01-23 00:47:08.195  4770  4770 D wpa_supplicant:    broadcast key
01-23 00:47:08.195  4770  4770 D wpa_supplicant: nl80211: set_key failed; err=-22 Invalid argument
01-23 00:47:08.196  4770  4770 W wpa_supplicant: wlan0: WPA: Failed to configure IGTK to the driver
01-23 00:47:08.196  4770  4770 I wpa_supplicant: wlan0: RSN: Failed to configure IGTK
01-23 00:47:08.196  1013  1013 E cnss-daemon: wlan_service_update_sys_param: unable to open /proc/sys/net/ipv4/tcp_limit_output_bytes
01-23 00:47:08.196  4770  4770 D wpa_supplicant: wlan0: Request to deauthenticate - bssid=XX:XX:XX:XX:XX:XX pending_bssid=XX:XX:XX:XX:XX:XX reason=1 (UNSPECIFIED) state=GROUP_HANDSHAKE
01-23 00:47:08.197  4770  4770 D wpa_supplicant: TDLS: Tear down peers
01-23 00:47:08.197  4770  4770 D wpa_supplicant: wpa_driver_nl80211_disconnect(reason_code=1)
01-23 00:47:08.204     0     0 I [wpa_su][0x145c5012b][00:47:08.204654] wlan: [4770:I:HDD] wlan0(vdevid-0): Received Disconnect reason:1 WLAN_REASON_UNSPECIFIED
01-23 00:47:08.204     0     0 E [wpa_su][0x145c51487][00:47:08.204912] wlan: [4770:E:SME] sme_ps_disable_uapsd_req_params: 256: UAPSD is already disabled
01-23 00:47:08.205     0     0 I [schedu][0x145c5293b][00:47:08.205188] wlan: [4765:I:PE] Disassoc TX: vdev 0 seq 2200 reason 1 and waitForAck 1 to XX:XX:XX:XX:XX:XX From XX:XX:XX:XX:XX:XX
01-23 00:47:08.209  1253  4319 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
01-23 00:47:08.209     0     0 I [schedu][0x145c64625][00:47:08.208987] wlan: [4765:I:TXRX] ol_txrx_peer_detach: 3477: ol_txrx_peer_detach peer 0000000000000000, peer->ref_cnt 10
01-23 00:47:08.209     0     0 I [schedu][0x145c6479f][00:47:08.209007] wlan: [4765:I:TXRX] ol_txrx_peer_detach: 3521: started peer_unmap_timer for peer 0000000000000000
01-23 00:47:08.209     0     0 I [soft_i][0x145c6764d][00:47:08.209629] wlan: [0:I:TXRX] ol_txrx_peer_release_ref: 3326: [9][0]: Deleting peer 0000000000000000 ref_cnt -> 0
01-23 00:47:08.211     0     0 I [schedu][0x145c7022f][00:47:08.211494] wlan: [4765:I:HDD] wlan0(vdevid-0): disconnected
01-23 00:47:08.211     0     0 I [schedu][0x145c70621][00:47:08.211547] wlan: [4765:I:HDD] hdd_disable_rx_ol_in_concurrency: 1975: Disable TCP delack as LRO is enabled
01-23 00:47:08.212  1013  1013 E cnss-daemon: wlan_service_update_sys_param: unable to open /proc/sys/net/ipv4/tcp_use_userconfig
01-23 00:47:08.212  4770  4770 D wpa_supplicant: wlan0: Event DEAUTH (11) received
01-23 00:47:08.213  4770  4770 D wpa_supplicant: wlan0: Deauthentication notification

Which tells me that nearly all steps of the WiFi encryption handshake pass, but then there's a failure with the group handshake.

Symptoms WiFi networks show up, but I can't connect to any of them.

How to reproduce Try to connect to an encrypted WiFi network.

Additional context I'm using the same setup as in: https://github.com/sonyxperiadev/bug_tracker/issues/823 but waited for https://github.com/sonyxperiadev/device-sony-seine/pull/60 to get merged and rebuilt.

I have uploaded the full output of adb logcat if it's of any help: wifi.log

bartcubbins commented 8 months ago

Oh, I see what is going on. Let me clarify, this happens on WPA3 network?

sudden6 commented 8 months ago

Yes, to be exact OpenWRT with: Encryption: mixed WPA2/WPA3 PSK, SAE (CCMP)

bartcubbins commented 8 months ago

The worst thing happened as I expected. The problem is common to all devices and is located in the CFG80211 API changes in one of the treewide: 4.19.* commits... Once I isolate the problem I will PR a fix with a solution

bartcubbins commented 8 months ago

Enjoy https://github.com/sonyxperiadev/kernel/pull/2604

bartcubbins commented 8 months ago

I'll push some optimization commits for qcacld-3.0 later but they are optional and not part of the fix.

sudden6 commented 7 months ago

I'm trying to build the ROM with your patches applied, but I get the following error:

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=13
TARGET_PRODUCT=aosp_xqau52
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.1.0-17-amd64-x86_64-Ubuntu-20.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=TQ3A.230901.001
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/sony/common device/sony/seine vendor/qcom/opensource/core-utils vendor/qcom/opensource/display/sm8250 vendor/qcom/opensource/display-commonsys-intf/sm8250
============================================
wildcard(out/target/product/pdx201/clean_steps.mk) was changed, regenerating...
FAILED: ninja: 'out/target/product/pdx201/kernel', needed by 'out/target/product/pdx201/recovery.img', missing and no known rule to make it
14:34:15 ninja failed with: exit status 1

#### failed to build some targets (01:24 (mm:ss)) ####

root@c435623e728d:/work/android# 

I tried to follow the guide from: https://developer.sony.com/open-source/aosp-on-xperia-open-devices/guides/kernel-compilation-guides/how-to-build-and-flash-a-linux-kernel-for-aosp-supported-devices/how-to-autimatically-build-the-linux-kernel/ but it seems to be outdated.

Can you point me to some commands on how to build with your patches applied?

bartcubbins commented 7 months ago

prebuilt kernel is missing, please build it with kernel/sony/msm-4.19/common-kernel/build-kernels-clang.sh

sudden6 commented 7 months ago

Thank you very much, I rebuilt the kernel with the script you suggested and then executed make -j4 again. The issue is now fixed and I can connect to the WiFi.

bartcubbins commented 7 months ago

Glad to help you!