Skip to content

Commit 629840e

Browse files
committed
Johannes Berg says: ==================== Some fixes for the current cycle: - mt76: MLO regressions, offchannel handling, list corruption - mac80211: scan allocation size, no 40 MHz EHT, signed type - rt2x00: (randconfig) build - cfg80211: use-after-free - iwlwifi: config/old devices, BIOS compatibility - mwifiex: vmalloc content leak * tag 'wireless-2025-08-28' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: (29 commits) wifi: iwlwifi: cfg: add back more lost PCI IDs wifi: iwlwifi: fix byte count table for old devices wifi: iwlwifi: cfg: restore some 1000 series configs wifi: mwifiex: Initialize the chan_stats array to zero wifi: mac80211: do not permit 40 MHz EHT operation on 5/6 GHz wifi: iwlwifi: uefi: check DSM item validity wifi: iwlwifi: acpi: check DSM func validity wifi: iwlwifi: if scratch is ~0U, consider it a failure wifi: mt76: fix linked list corruption wifi: mt76: free pending offchannel tx frames on wcid cleanup wifi: mt76: mt7915: fix list corruption after hardware restart wifi: mt76: mt7996: add missing check for rx wcid entries wifi: mt76: do not add non-sta wcid entries to the poll list wifi: mt76: mt7996: fix crash on some tx status reports wifi: mt76: mt7996: use the correct vif link for scanning/roc wifi: mt76: mt7996: disable beacons when going offchannel wifi: mt76: prevent non-offchannel mgmt tx during scan/roc wifi: mt76: mt7925: skip EHT MLD TLV on non-MLD and pass conn_state for sta_cmd wifi: mt76: mt7925u: use connac3 tx aggr check in tx complete wifi: mt76: mt7925: fix the wrong bss cleanup for SAP ... ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 9c736ac + 2c72c8d commit 629840e

File tree

26 files changed

+232
-76
lines changed

26 files changed

+232
-76
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,8 @@ void brcmf_btcoex_detach(struct brcmf_cfg80211_info *cfg)
393393
if (!cfg->btcoex)
394394
return;
395395

396-
if (cfg->btcoex->timer_on) {
397-
cfg->btcoex->timer_on = false;
398-
timer_shutdown_sync(&cfg->btcoex->timer);
399-
}
396+
timer_shutdown_sync(&cfg->btcoex->timer);
397+
cfg->btcoex->timer_on = false;
400398

401399
cancel_work_sync(&cfg->btcoex->work);
402400

drivers/net/wireless/intel/iwlwifi/fw/acpi.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ int iwl_acpi_get_dsm(struct iwl_fw_runtime *fwrt,
169169

170170
BUILD_BUG_ON(ARRAY_SIZE(acpi_dsm_size) != DSM_FUNC_NUM_FUNCS);
171171

172-
if (WARN_ON(func >= ARRAY_SIZE(acpi_dsm_size)))
172+
if (WARN_ON(func >= ARRAY_SIZE(acpi_dsm_size) || !func))
173173
return -EINVAL;
174174

175175
expected_size = acpi_dsm_size[func];
@@ -178,6 +178,29 @@ int iwl_acpi_get_dsm(struct iwl_fw_runtime *fwrt,
178178
if (expected_size != sizeof(u8) && expected_size != sizeof(u32))
179179
return -EOPNOTSUPP;
180180

181+
if (!fwrt->acpi_dsm_funcs_valid) {
182+
ret = iwl_acpi_get_dsm_integer(fwrt->dev, ACPI_DSM_REV,
183+
DSM_FUNC_QUERY,
184+
&iwl_guid, &tmp,
185+
acpi_dsm_size[DSM_FUNC_QUERY]);
186+
if (ret) {
187+
/* always indicate BIT(0) to avoid re-reading */
188+
fwrt->acpi_dsm_funcs_valid = BIT(0);
189+
return ret;
190+
}
191+
192+
IWL_DEBUG_RADIO(fwrt, "ACPI DSM validity bitmap 0x%x\n",
193+
(u32)tmp);
194+
/* always indicate BIT(0) to avoid re-reading */
195+
fwrt->acpi_dsm_funcs_valid = tmp | BIT(0);
196+
}
197+
198+
if (!(fwrt->acpi_dsm_funcs_valid & BIT(func))) {
199+
IWL_DEBUG_RADIO(fwrt, "ACPI DSM %d not indicated as valid\n",
200+
func);
201+
return -ENODATA;
202+
}
203+
181204
ret = iwl_acpi_get_dsm_integer(fwrt->dev, ACPI_DSM_REV, func,
182205
&iwl_guid, &tmp, expected_size);
183206
if (ret)

drivers/net/wireless/intel/iwlwifi/fw/runtime.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ struct iwl_txf_iter_data {
113113
* @phy_filters: specific phy filters as read from WPFC BIOS table
114114
* @ppag_bios_rev: PPAG BIOS revision
115115
* @ppag_bios_source: see &enum bios_source
116+
* @acpi_dsm_funcs_valid: bitmap indicating which DSM values are valid,
117+
* zero (default initialization) means it hasn't been read yet,
118+
* and BIT(0) is set when it has since function 0 also has this
119+
* bitmap and is always supported
116120
*/
117121
struct iwl_fw_runtime {
118122
struct iwl_trans *trans;
@@ -189,6 +193,10 @@ struct iwl_fw_runtime {
189193
bool uats_valid;
190194
u8 uefi_tables_lock_status;
191195
struct iwl_phy_specific_cfg phy_filters;
196+
197+
#ifdef CONFIG_ACPI
198+
u32 acpi_dsm_funcs_valid;
199+
#endif
192200
};
193201

194202
void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,

drivers/net/wireless/intel/iwlwifi/fw/uefi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,12 @@ int iwl_uefi_get_dsm(struct iwl_fw_runtime *fwrt, enum iwl_dsm_funcs func,
747747
goto out;
748748
}
749749

750+
if (!(data->functions[DSM_FUNC_QUERY] & BIT(func))) {
751+
IWL_DEBUG_RADIO(fwrt, "DSM func %d not in 0x%x\n",
752+
func, data->functions[DSM_FUNC_QUERY]);
753+
goto out;
754+
}
755+
750756
*value = data->functions[func];
751757

752758
IWL_DEBUG_RADIO(fwrt,

drivers/net/wireless/intel/iwlwifi/pcie/drv.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info iwl_dev_info_table[] = {
673673

674674
IWL_DEV_INFO(iwl6005_n_cfg, iwl6005_2agn_sff_name,
675675
DEVICE(0x0082), SUBDEV_MASKED(0xC000, 0xF000)),
676+
IWL_DEV_INFO(iwl6005_n_cfg, iwl6005_2agn_sff_name,
677+
DEVICE(0x0085), SUBDEV_MASKED(0xC000, 0xF000)),
676678
IWL_DEV_INFO(iwl6005_n_cfg, iwl6005_2agn_d_name,
677679
DEVICE(0x0082), SUBDEV(0x4820)),
678680
IWL_DEV_INFO(iwl6005_n_cfg, iwl6005_2agn_mow1_name,
@@ -729,10 +731,10 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info iwl_dev_info_table[] = {
729731
DEVICE(0x0083), SUBDEV_MASKED(0x5, 0xF)),
730732
IWL_DEV_INFO(iwl1000_bg_cfg, iwl1000_bg_name,
731733
DEVICE(0x0083), SUBDEV_MASKED(0x6, 0xF)),
734+
IWL_DEV_INFO(iwl1000_bgn_cfg, iwl1000_bgn_name,
735+
DEVICE(0x0084), SUBDEV_MASKED(0x5, 0xF)),
732736
IWL_DEV_INFO(iwl1000_bg_cfg, iwl1000_bg_name,
733-
DEVICE(0x0084), SUBDEV(0x1216)),
734-
IWL_DEV_INFO(iwl1000_bg_cfg, iwl1000_bg_name,
735-
DEVICE(0x0084), SUBDEV(0x1316)),
737+
DEVICE(0x0084), SUBDEV_MASKED(0x6, 0xF)),
736738

737739
/* 100 Series WiFi */
738740
IWL_DEV_INFO(iwl100_bgn_cfg, iwl100_bgn_name,
@@ -964,6 +966,12 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info iwl_dev_info_table[] = {
964966
DEVICE(0x24F3), SUBDEV(0x0004)),
965967
IWL_DEV_INFO(iwl8260_cfg, iwl8260_2n_name,
966968
DEVICE(0x24F3), SUBDEV(0x0044)),
969+
IWL_DEV_INFO(iwl8260_cfg, iwl8260_2ac_name,
970+
DEVICE(0x24F4)),
971+
IWL_DEV_INFO(iwl8260_cfg, iwl4165_2ac_name,
972+
DEVICE(0x24F5)),
973+
IWL_DEV_INFO(iwl8260_cfg, iwl4165_2ac_name,
974+
DEVICE(0x24F6)),
967975
IWL_DEV_INFO(iwl8265_cfg, iwl8265_2ac_name,
968976
DEVICE(0x24FD)),
969977
IWL_DEV_INFO(iwl8265_cfg, iwl8275_2ac_name,
@@ -1222,11 +1230,15 @@ static int _iwl_pci_resume(struct device *device, bool restore)
12221230
* Note: MAC (bits 0:7) will be cleared upon suspend even with wowlan,
12231231
* but not bits [15:8]. So if we have bits set in lower word, assume
12241232
* the device is alive.
1233+
* Alternatively, if the scratch value is 0xFFFFFFFF, then we no longer
1234+
* have access to the device and consider it powered off.
12251235
* For older devices, just try silently to grab the NIC.
12261236
*/
12271237
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) {
1228-
if (!(iwl_read32(trans, CSR_FUNC_SCRATCH) &
1229-
CSR_FUNC_SCRATCH_POWER_OFF_MASK))
1238+
u32 scratch = iwl_read32(trans, CSR_FUNC_SCRATCH);
1239+
1240+
if (!(scratch & CSR_FUNC_SCRATCH_POWER_OFF_MASK) ||
1241+
scratch == ~0U)
12301242
device_was_powered_off = true;
12311243
} else {
12321244
/*

drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,8 @@ static void iwl_txq_gen1_update_byte_cnt_tbl(struct iwl_trans *trans,
20922092
break;
20932093
}
20942094

2095-
if (trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
2095+
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_9000 &&
2096+
trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
20962097
len = DIV_ROUND_UP(len, 4);
20972098

20982099
if (WARN_ON(len > 0xFFF || write_ptr >= TFD_QUEUE_SIZE_MAX))

drivers/net/wireless/marvell/mwifiex/cfg80211.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4673,8 +4673,9 @@ int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter)
46734673
* additional active scan request for hidden SSIDs on passive channels.
46744674
*/
46754675
adapter->num_in_chan_stats = 2 * (n_channels_bg + n_channels_a);
4676-
adapter->chan_stats = vmalloc(array_size(sizeof(*adapter->chan_stats),
4677-
adapter->num_in_chan_stats));
4676+
adapter->chan_stats = kcalloc(adapter->num_in_chan_stats,
4677+
sizeof(*adapter->chan_stats),
4678+
GFP_KERNEL);
46784679

46794680
if (!adapter->chan_stats)
46804681
return -ENOMEM;

drivers/net/wireless/marvell/mwifiex/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ static int _mwifiex_fw_dpc(const struct firmware *firmware, void *context)
642642
goto done;
643643

644644
err_add_intf:
645-
vfree(adapter->chan_stats);
645+
kfree(adapter->chan_stats);
646646
err_init_chan_scan:
647647
wiphy_unregister(adapter->wiphy);
648648
wiphy_free(adapter->wiphy);
@@ -1485,7 +1485,7 @@ static void mwifiex_uninit_sw(struct mwifiex_adapter *adapter)
14851485
wiphy_free(adapter->wiphy);
14861486
adapter->wiphy = NULL;
14871487

1488-
vfree(adapter->chan_stats);
1488+
kfree(adapter->chan_stats);
14891489
mwifiex_free_cmd_buffers(adapter);
14901490
}
14911491

drivers/net/wireless/mediatek/mt76/mac80211.c

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,43 @@ void mt76_free_device(struct mt76_dev *dev)
818818
}
819819
EXPORT_SYMBOL_GPL(mt76_free_device);
820820

821+
static void mt76_reset_phy(struct mt76_phy *phy)
822+
{
823+
if (!phy)
824+
return;
825+
826+
INIT_LIST_HEAD(&phy->tx_list);
827+
}
828+
829+
void mt76_reset_device(struct mt76_dev *dev)
830+
{
831+
int i;
832+
833+
rcu_read_lock();
834+
for (i = 0; i < ARRAY_SIZE(dev->wcid); i++) {
835+
struct mt76_wcid *wcid;
836+
837+
wcid = rcu_dereference(dev->wcid[i]);
838+
if (!wcid)
839+
continue;
840+
841+
wcid->sta = 0;
842+
mt76_wcid_cleanup(dev, wcid);
843+
rcu_assign_pointer(dev->wcid[i], NULL);
844+
}
845+
rcu_read_unlock();
846+
847+
INIT_LIST_HEAD(&dev->wcid_list);
848+
INIT_LIST_HEAD(&dev->sta_poll_list);
849+
dev->vif_mask = 0;
850+
memset(dev->wcid_mask, 0, sizeof(dev->wcid_mask));
851+
852+
mt76_reset_phy(&dev->phy);
853+
for (i = 0; i < ARRAY_SIZE(dev->phys); i++)
854+
mt76_reset_phy(dev->phys[i]);
855+
}
856+
EXPORT_SYMBOL_GPL(mt76_reset_device);
857+
821858
struct mt76_phy *mt76_vif_phy(struct ieee80211_hw *hw,
822859
struct ieee80211_vif *vif)
823860
{
@@ -1679,6 +1716,10 @@ void mt76_wcid_cleanup(struct mt76_dev *dev, struct mt76_wcid *wcid)
16791716
skb_queue_splice_tail_init(&wcid->tx_pending, &list);
16801717
spin_unlock(&wcid->tx_pending.lock);
16811718

1719+
spin_lock(&wcid->tx_offchannel.lock);
1720+
skb_queue_splice_tail_init(&wcid->tx_offchannel, &list);
1721+
spin_unlock(&wcid->tx_offchannel.lock);
1722+
16821723
spin_unlock_bh(&phy->tx_lock);
16831724

16841725
while ((skb = __skb_dequeue(&list)) != NULL) {
@@ -1690,7 +1731,7 @@ EXPORT_SYMBOL_GPL(mt76_wcid_cleanup);
16901731

16911732
void mt76_wcid_add_poll(struct mt76_dev *dev, struct mt76_wcid *wcid)
16921733
{
1693-
if (test_bit(MT76_MCU_RESET, &dev->phy.state))
1734+
if (test_bit(MT76_MCU_RESET, &dev->phy.state) || !wcid->sta)
16941735
return;
16951736

16961737
spin_lock_bh(&dev->sta_poll_lock);

drivers/net/wireless/mediatek/mt76/mt76.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
12431243
struct ieee80211_rate *rates, int n_rates);
12441244
void mt76_unregister_device(struct mt76_dev *dev);
12451245
void mt76_free_device(struct mt76_dev *dev);
1246+
void mt76_reset_device(struct mt76_dev *dev);
12461247
void mt76_unregister_phy(struct mt76_phy *phy);
12471248

12481249
struct mt76_phy *mt76_alloc_radio_phy(struct mt76_dev *dev, unsigned int size,

0 commit comments

Comments
 (0)