linelessos / android_kernel_sony_msm8996

Other
2 stars 6 forks source link

fix for wl_cfg80211_mgmt_tx kernel panic issue #1

Closed ext32 closed 2 years ago

ext32 commented 2 years ago

The lower level nl80211 code in cfg80211 ensures that "len" is between 25 and NL80211_ATTR_FRAME (2304). Without this bcmdhd crash randomly and makes the phone reboot. just followed the same logic as brcmfmac fix for the same issue . The phone is up and running without a reboot for more than 36 hours now with this fix.. Please review the brcmfmac fix here https://patchwork.kernel.org/project/linux-wireless/patch/1499428893-30750-1-git-send-email-arend.vanspriel@broadcom.com/.

Also please consider that in line 6706 there is also a chech for action frame len size. I dont know why the code at line 6706 which is pretty much the same does not apply correctly and allow the crash to happen. I havent removed it because its not exact the same command. The first command returns an error the second command returns an error and terminate.

erikcas commented 2 years ago

The earlier check lacks bailing out (goto exit) if I do read correctly on phone. Dunno if that breaks something, will do some reading (need time, I have been inactive for a while)

Thanx for this patch, we need to have this tested. @sjllls shall I put some fresh builds up somewhere for Dora / kagura? If oke, lets merge it, we can always consider the above mentioned option later.

ext32 commented 2 years ago

i think the earlier check makes no sense for newer kernels. newer kernels use embedded code from includes which does not initialized early(like inlline code does) . Anyway i have read a lot both of the drivers source code (bcmdhd and brcfmac) to understand the logic (which btw is the same , only functions and variables change names) and i think that the position of the check should be there .

Please test and let me know.

ext32 commented 2 years ago

The upper check does not apply for sure , at least for my device. I start over fresh kernel from this repository . I get kernel panic every 1 or 2 hours . Applying the patch solve the problem.

erikcas commented 2 years ago

this applies to me too. Can you try to fix the indentions properly and force push the commit? If not, let me know, I will fix it ;) Then we can merge.

ext32 commented 2 years ago

ok . Btw i have updated a bit the driver from sony sources . Please check https://github.com/ext32/bcmdhd. Maybe this fix is not needed on updated driver , i have to check .

sjllls commented 2 years ago

Sorry for late reply, because of some reasons, I can't test these codes or reply on Telegram until I back home, you can merge them if they are right.

sjllls commented 2 years ago

@ext32 Sorry for late reply, do you still work on this patch?

ext32 commented 2 years ago

On 7/4/2022 14:15, sjllls wrote:

@ext32 https://github.com/ext32 Sorry for late reply, do you still work on this patch?

— Reply to this email directly, view it on GitHub https://github.com/linelessos/android_kernel_sony_msm8996/pull/1#issuecomment-1091608706, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXV3URQEEBZ5446L5OMVJLVD27WTANCNFSM5MYWMJCA. You are receiving this because you were mentioned.Message ID: @.***>

Yes i am working on bcmdhd for dora because wifi was unusable.Phone reboots , wifi unstable , etc. For now i have stable wifi and phone, please check https://github.com/ext32/bcmdhd. There are some commits i a testing and not commited yet but those should be ok for basic usage.

sjllls commented 2 years ago

Yes i am working on bcmdhd for dora because wifi was unusable.Phone reboots , wifi unstable , etc. For now i have stable wifi and phone, please check https://github.com/ext32/bcmdhd. There are some commits i a testing and not commited yet but those should be ok for basic usage.

Can you do a new clean PR to this repository? I will test it after I get my new SSD.

erikcas commented 2 years ago

@ext32 if cleaning up is hard, let me know, I will help you with it.

ext32 commented 2 years ago

On 19/4/2022 12:00, Erik Castricum wrote:

@ext32 https://github.com/ext32 if cleaning up is hard, let me know, I will help you with it.

— Reply to this email directly, view it on GitHub https://github.com/linelessos/android_kernel_sony_msm8996/pull/1#issuecomment-1102339517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXV3URHRX5JOQINY2T4WLTVFZY27ANCNFSM5MYWMJCA. You are receiving this because you were mentioned.Message ID: @.***>

please check https://github.com/sjllls/android_kernel_sony_msm8996/pull/2

includes all the fixes for a stable , usable , xperia x performance phone

i know that it is wrong to apply patches without explanation

but i have it here as a reference mostly for me and my effort

sjllls commented 2 years ago

@erikcas After one week test, it seems that this PR fixed the wifi issue.

erikcas commented 2 years ago

@erikcas After one week test, it seems that this PR fixed the wifi issue.

Cool. I will cleanup the commit and push it today (ofc @ext32 will be the committer).

I will evaluate the commits from https://github.com/ext32/bcmdhd lateron.

erikcas commented 2 years ago

need to fix the indention, will do a force push for that

ext32 commented 2 years ago

On 8/4/2022 13:59, sjllls wrote:

Yes i am working on bcmdhd for dora because wifi was
unusable.Phone reboots , wifi unstable , etc. For now i have
stable wifi and phone, please check
https://github.com/ext32/bcmdhd. There are some commits i a
testing and not commited yet but those should be ok for basic usage.

Can you do a new clean PR to this repository? I will test it after I get my new SSD.

— Reply to this email directly, view it on GitHub https://github.com/linelessos/android_kernel_sony_msm8996/pull/1#issuecomment-1092741178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXV3USR2ESXIBGXVW2ZG2DVEAGSXANCNFSM5MYWMJCA. You are receiving this because you were mentioned.Message ID: @.***>

ok i will upload my whole kernel tree for sony-msm8996.It is a big effort , i dont know if i can track every change with a single well defined commit. But i think someone should try this kernel , it has huge improvements in power management(i will charge my device every two and a half days),security (i have applied all patches from mainline) and ofcourse usability(phone not rebooting anymore every few hours). I will start from there and i hopefully sometime can do a pr for every change.