mt792x: mainline NULL-deref fix 7825de3f75d1 missing from mt76 tree — downstream syncs ship the crash

Open Beginner friendly
#1,158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c, linux

Research direction

Start with mt792x_init_acpi_sar_power() in mt792x_acpi_sar.c, then compare the tree with mainline commits 7825de3f75d1, 45f53d98cbaa, and af97bf5a7e72. Confirm that ACPI SAR initialization safely handles a missing wiphy->sar_capa without affecting probe. Done means the relevant upstream fixes are present in the mt76 tree and the MT7922/MT7925 NULL-dereference path is covered or otherwise verifiable.

Written by the indexing model from the issue text.

Description

mt792x_init_acpi_sar_power() in master still dereferences wiphy->sar_capa without a NULL check. On machines with an ACPI SAR table (MT7922 and MT7925), this crashes mt7921_init_work at probe, and the Wi-Fi interface never comes up:

BUG: kernel NULL pointer dereference, address: 0000000000000004
Workqueue: events mt7921_init_work [mt7921_common]
RIP: 0010:mt792x_init_acpi_sar_power+0x34/0x210 [mt792x_lib]
 mt7921_set_tx_sar_pwr
 __mt7921_mcu_regd_update
 mt7921_regd_update
 mt7921_regd_init
 mt7921_load_clc
 mt7921_run_firmware
 mt7921e_mcu_init
 mt7921_init_work

Mainline fixed this in 7825de3f75d1 ("wifi: mt76: mt792x: fix NULL dereference in ACPI SAR init during probe", v7.3-rc3). Linus applied it straight from the list, so it never went through this tree:
https://git.kernel.org/torvalds/c/7825de3f75d184612d77655669a04ea0da252c17

Because of this, downstream kernels that sync mt76 from here get the regression without the fix. Pop!_OS shipped it in linux-system76 7.2.6 ("Sync mt76 module entirely from openwrt"). On my mother's ASUS Zenbook 14 UM3406KA (MT7922 14c3:0616, subsystem 105b:e0de), the result is no Wi-Fi plus hangs on shutdown and suspend.

Could you pull 7825de3f75d1 into the mt76 tree? 45f53d98cbaa and af97bf5a7e72 from mainline touch mt792x_acpi_sar.c as well and also look missing.

oops-excerpt.txt

Downstream report

Dominant language
C
Stars
895
Forks
461
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openwrt/mt76

All issues in openwrt/mt76

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.