Repository navigation
WiFi broke on kernel 5.8.3 #54
Description
Activity
I can't reproduce this on my SB2 with my home WiFi. There haven't been any changes between 5.8.1 to 5.8.3 to the WiFi drivers from our side, so if any change caused this, it should be an upstream one. If you want to track this down, you should merge upstream v5.8.3 on top of v5.8-surface-devel (which is based off of v5.8) and bisect from there.
- addedC: bug (upstream)Category: Upstream bug (tracked upstream)Category: Upstream bug (tracked upstream)
on Aug 24, 2020 As far as I can tell, this seems to be the only commit to mwifiex that could cause something like this: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.8.y&id=bc2599182f8ec577ca81a6de40349e94fb9734df
Small update, the kernel from the commit i mentioned (233bcf2) doesn't have this problem. I am currently trying to setup anbox, after which i might investigate why the WiFi wasn't working as intended on 5.8.3 . My kernel knowledge is pretty bad but I will try to do my best to find the issue.
Wanted to chime in and say I have been having this issue since last night on my Surface Pro 6 too. WiFi works out of the box after installation of a distro, but fails to authenticate with my home WiFi password-protected network after installing the Linux-Surface kernel. Simply keeps asking to introduce the password. Occurs on Ubuntu 20.04 (and derivatives Pop_OS and KDE Neon) as well as Manjaro.
Connects to my phone hotspot fine but not to my home WiFi network. WiFi works perfectly on Windows, but no surprises there.
Wanted to chime in and say I have been having this issue since last night on my Surface Pro 6 too. WiFi works out of the box after installation of a distro, but fails to authenticate with my home WiFi password-protected network after installing the Linux-Surface kernel. Simply keeps asking to introduce the password. Occurs on Ubuntu 20.04 (and derivatives Pop_OS and KDE Neon) as well as Manjaro.
Connects to my phone hotspot fine but not to my home WiFi network. WiFi works perfectly on Windows, but no surprises there.
Exactly the same behavior as me then, I forgot to mention the repeated asking for the password.
EDIT: Probably unrelated since this has been happening for a while now, but since at least 5.7 my wifi is extremely slow (max 1-2mbps) until i turn off bluetooth. I doubt it's connected but in case it helps I wanted to mention it.
@sleepyeldrazi I kind of expected that that commit works, as it's based on v5.8 and not v5.8.3. Can you try building a v5.8.3 kernel (e.g. from the
v5.8-surfacebranch) and add some debug output to the commit I linked above? Specifically replace it with something like (adding in thepr_errcalls):diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c index f21660149f584..962d8bfe6f101 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c @@ -580,6 +580,11 @@ static int mwifiex_ret_802_11_key_material_v1(struct mwifiex_private *priv, { struct host_cmd_ds_802_11_key_material *key = &resp->params.key_material; + int len; + + len = le16_to_cpu(key->key_param_set.key_len); + if (len > sizeof(key->key_param_set.key)) { + pr_err("mwifiex-DEBUG: len > sizeof(key->key_param_set.key in %s\n", __func__); + pr_err("mwifiex-DEBUG: len: %u\n", len); + return -EINVAL; + } if (le16_to_cpu(key->action) == HostCmd_ACT_GEN_SET) { if ((le16_to_cpu(key->key_param_set.key_info) & KEY_MCAST)) { @@ -593,9 +598,8 @@ static int mwifiex_ret_802_11_key_material_v1(struct mwifiex_private *priv, memset(priv->aes_key.key_param_set.key, 0, sizeof(key->key_param_set.key)); - priv->aes_key.key_param_set.key_len = key->key_param_set.key_len; - memcpy(priv->aes_key.key_param_set.key, key->key_param_set.key, - le16_to_cpu(priv->aes_key.key_param_set.key_len)); + priv->aes_key.key_param_set.key_len = cpu_to_le16(len); + memcpy(priv->aes_key.key_param_set.key, key->key_param_set.key, len); return 0; } @@ -610,9 +614,14 @@ static int mwifiex_ret_802_11_key_material_v2(struct mwifiex_private *priv, struct host_cmd_ds_command *resp) { struct host_cmd_ds_802_11_key_material_v2 *key_v2; - __le16 len; + int len; key_v2 = &resp->params.key_material_v2; + + len = le16_to_cpu(key_v2->key_param_set.key_params.aes.key_len); + if (len > WLAN_KEY_LEN_CCMP) + pr_err("mwifiex-DEBUG: len > sizeof(key->key_param_set.key in %s\n", __func__); + pr_err("mwifiex-DEBUG: len: %u\n", len); + return -EINVAL; + } + if (le16_to_cpu(key_v2->action) == HostCmd_ACT_GEN_SET) { if ((le16_to_cpu(key_v2->key_param_set.key_info) & KEY_MCAST)) { mwifiex_dbg(priv->adapter, INFO, "info: key: GTK is set\n"); @@ -628,10 +637,9 @@ static int mwifiex_ret_802_11_key_material_v2(struct mwifiex_private *priv, memset(priv->aes_key_v2.key_param_set.key_params.aes.key, 0, WLAN_KEY_LEN_CCMP); priv->aes_key_v2.key_param_set.key_params.aes.key_len = - key_v2->key_param_set.key_params.aes.key_len; - len = priv->aes_key_v2.key_param_set.key_params.aes.key_len; + cpu_to_le16(len); memcpy(priv->aes_key_v2.key_param_set.key_params.aes.key, - key_v2->key_param_set.key_params.aes.key, le16_to_cpu(len)); + key_v2->key_param_set.key_params.aes.key, len); return 0; }
And then check the dmesg log.
Edit: Added a
pr_errstatement for printing the actual length.The speed/bluetooth thing is a known issue and tracked somewhere on the linux-surface repo.
I can't reproduce this on my SB2 with my home WiFi. There haven't been any changes between 5.8.1 to 5.8.3 to the WiFi drivers from our side, so if any change caused this, it should be an upstream one. If you want to track this down, you should merge upstream v5.8.3 on top of v5.8-surface-devel (which is based off of v5.8) and bisect from there.
Right, so here's what I did (Surface Pro 6):
- Resize Windows 10 partition in Windows' Disk Management
- Install Pop_OS 20.04 (Wi-Fi working)
- Follow the linux-surface installation guide here (Wi-Fi still working)
- Reboot
- Touchscreen etc. working under Linux-Surface kernel, but can't connect to Wi-Fi network I was previously connecting to as per detailed in my prior comment.
Please let me know if there's some way I can be of use; I'd like to also provide the dmesg log you asked @sleepyeldrazi for if it'd be of any use to you, but honestly I'm not super Linux-savvy and am lost as to how to help.
@elChupaCambra I assume that this can only be reproduced on certain network configurations. If my guess with the commit above is correct, it should depend on the key length (nb: key is not password here).
Reacted by Claudio Cambradmesg.txt
dmesg_grep_mwifiex.txt
One is the complete dmesg, the other is with grep mwifiex. Sorry for the wait.Reacted by Claudio CambraAlright, looks like my assumption was correct. The log reports a key size of 256 bit (32 bytes), but the storage is only 128 bit (16 bytes), and with the newly introduced check, it fails there. Given that it more or less worked before adding that check, I'd say we try upgrade that to 32 bytes. Here's a patch that does that (don't be confused by the
.txtending, GitHub doesn't allow uploading patches in comments). Can you try applying that to thev5.3-surfacebranch and test again?EDIT: It looks like i really did apply the patch wrong. It works now. I'll remove the pr_err checks and build again just in case and I'll post my git diff at the end.
diff.txt
Wifi works as expected now. Thanks for the support.Hi @qzed and @sleepyeldrazi, thanks for the hard work. How can a newbie like myself apply this patch?
I have found the folder:
"/usr/lib/modules/5.8.3-arch1-1-surface/kernel/drivers/net/wireless/marvell/mwifiex/" which seems similar to the one you posted in your .txt files, except I can't find the "fw.h" or "sta_cmdresp.c" files on my Manjaro install. Is this because you guys are talking about files changed before building the linux-surface kernel? If so, could you point me to how I can apply this patch (or a resource that could show me how to do so?)Thank you for your time!
20 remaining items
- added a commit that references this issue
on Nov 20, 2021 - added a commit that references this issue
on Nov 29, 2021 - added a commit that references this issue
on Dec 8, 2021 - added a commit that references this issue
on Mar 11, 2022 - added a commit that references this issue
on Mar 11, 2022 - added 2 commits that reference this issue
on Jan 2, 2023 - added 2 commits that reference this issue
on Mar 11, 2023 - added 2 commits that reference this issue
on Jun 2, 2023 - added a commit that references this issue
on Jul 27, 2026
Device: Surface Book 2
Distro: Manjaro
Previous Kernel: 5.8.1
Kernel After Update: 5.8.3
Date of Update: 24. Aug 2020
Kernel downloaded through yay from the repo: https://pkg.surfacelinux.com/arch/
I should mention that i couldn't connect to neither the 2.4GHz nor 5Ghz network from my router. I was however able to connect to a mobile hotspot (OnePlus 6T). After downgrading to 5.8.1 the issue was instantly resolved. I will attempt to build from commit 233bcf2 and see if works there.