Skip to content

Commit a0d82fb

Browse files
author
Paolo Abeni
committed
Johannes Berg says: ==================== Too many robustness fixes to list. Mostly for - slight out-of-bounds reads of SKBs, - leaks on error conditions, and - malformed netlink input rejection. * tag 'wireless-2026-07-09' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: (46 commits) wifi: cfg80211: bound element ID read when checking non-inheritance wifi: brcmfmac: cyw: fix heap overflow on a short auth frame wifi: brcmfmac: initialize SDIO data work before cleanup wifi: cfg80211: validate assoc response length before status and IE access wifi: cfg80211: validate rx/tx MLME callback frame lengths before access wifi: mac80211: ibss: wait for in-flight TX on disconnect wifi: mac80211: recalculate rx_nss on IBSS peer capability update wifi: cfg80211: use wiphy work for socket owner autodisconnect wifi: mac80211: fix memory leak in ieee80211_register_hw() wifi: mac80211: free AP_VLAN bc_buf SKBs outside IRQ lock wifi: mac80211: validate deauth frame length before reason access wifi: mac80211: avoid non-S1G AID fallback for S1G assoc wifi: cfg80211: reject empty PMSR peer lists wifi: cfg80211: reject unsupported PMSR FTM location requests wifi: cfg80211: validate PMSR FTM preamble range wifi: cfg80211: validate PMSR measurement type data wifi: nl80211: constrain MBSSID TX link ID range wifi: nl80211: validate nested MBSSID IE blobs wifi: ieee80211: validate MLE common info length wifi: cfg80211: derive S1G beacon TSF from S1G fields ... ==================== Link: https://patch.msgid.link/20260709115038.243870-3-johannes@sipsolutions.net Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents 4fa3491 + cb8afea commit a0d82fb

37 files changed

Lines changed: 334 additions & 132 deletions

File tree

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ brcmf_notify_auth_frame_rx(struct brcmf_if *ifp,
293293
return -EINVAL;
294294
}
295295

296+
if (mgmt_frame_len < offsetof(struct ieee80211_mgmt, u)) {
297+
bphy_err(drvr, "Event %s (%d) frame too small. Ignore\n",
298+
brcmf_fweh_event_name(e->event_code), e->event_code);
299+
return -EINVAL;
300+
}
301+
296302
wdev = &ifp->vif->wdev;
297303
WARN_ON(!wdev);
298304

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4465,6 +4465,7 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
44654465
bus->sdiodev = sdiodev;
44664466
sdiodev->bus = bus;
44674467
skb_queue_head_init(&bus->glom);
4468+
INIT_WORK(&bus->datawork, brcmf_sdio_dataworker);
44684469
bus->txbound = BRCMF_TXBOUND;
44694470
bus->rxbound = BRCMF_RXBOUND;
44704471
bus->txminmax = BRCMF_TXMINMAX;
@@ -4479,7 +4480,6 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
44794480
goto fail;
44804481
}
44814482
brcmf_sdiod_freezer_count(sdiodev);
4482-
INIT_WORK(&bus->datawork, brcmf_sdio_dataworker);
44834483
bus->brcmf_wq = wq;
44844484

44854485
/* attempt to attach to the dongle */

drivers/net/wireless/intel/ipw2x00/ipw2100.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6157,6 +6157,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
61576157
if (err) {
61586158
printk(KERN_WARNING DRV_NAME
61596159
"Error calling pci_enable_device.\n");
6160+
free_libipw(dev, 0);
6161+
pci_iounmap(pci_dev, ioaddr);
61606162
return err;
61616163
}
61626164

@@ -6169,16 +6171,14 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
61696171
if (err) {
61706172
printk(KERN_WARNING DRV_NAME
61716173
"Error calling pci_set_dma_mask.\n");
6172-
pci_disable_device(pci_dev);
6173-
return err;
6174+
goto fail;
61746175
}
61756176

61766177
err = pci_request_regions(pci_dev, DRV_NAME);
61776178
if (err) {
61786179
printk(KERN_WARNING DRV_NAME
61796180
"Error calling pci_request_regions.\n");
6180-
pci_disable_device(pci_dev);
6181-
return err;
6181+
goto fail;
61826182
}
61836183

61846184
/* We disable the RETRY_TIMEOUT register (0x41) to keep

drivers/net/wireless/intel/ipw2x00/libipw_rx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
414414
ieee->host_mc_decrypt : ieee->host_decrypt;
415415

416416
if (can_be_decrypted) {
417-
if (skb->len >= hdrlen + 3) {
417+
if (skb->len >= hdrlen + 4) {
418418
/* Top two-bits of byte 3 are the key index */
419419
keyidx = skb->data[hdrlen + 3] >> 6;
420420
}
@@ -660,7 +660,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
660660
int trimlen = 0;
661661

662662
/* Top two-bits of byte 3 are the key index */
663-
if (skb->len >= hdrlen + 3)
663+
if (skb->len >= hdrlen + 4)
664664
keyidx = skb->data[hdrlen + 3] >> 6;
665665

666666
/* To strip off any security data which appears before the

drivers/net/wireless/intersil/p54/txrx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,11 +499,19 @@ static void p54_rx_eeprom_readback(struct p54_common *priv,
499499
if (le16_to_cpu(eeprom->v2.len) != priv->eeprom_slice_size)
500500
return;
501501

502+
if (eeprom->v2.data + priv->eeprom_slice_size >
503+
skb_tail_pointer(skb))
504+
return;
505+
502506
memcpy(priv->eeprom, eeprom->v2.data, priv->eeprom_slice_size);
503507
} else {
504508
if (le16_to_cpu(eeprom->v1.len) != priv->eeprom_slice_size)
505509
return;
506510

511+
if (eeprom->v1.data + priv->eeprom_slice_size >
512+
skb_tail_pointer(skb))
513+
return;
514+
507515
memcpy(priv->eeprom, eeprom->v1.data, priv->eeprom_slice_size);
508516
}
509517

drivers/net/wireless/marvell/libertas/firmware.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ static void helper_firmware_cb(const struct firmware *firmware, void *context)
7878
} else {
7979
/* No main firmware needed for this helper --> success! */
8080
lbs_fw_loaded(priv, 0, firmware, NULL);
81+
release_firmware(firmware);
8182
}
8283
}
8384

drivers/net/wireless/marvell/libertas/tx.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
117117
if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR) {
118118
struct tx_radiotap_hdr *rtap_hdr = (void *)skb->data;
119119

120+
if (skb->len < sizeof(*rtap_hdr) + 4 + ETH_ALEN) {
121+
lbs_deb_tx("tx err: short monitor frame %u\n", skb->len);
122+
dev->stats.tx_dropped++;
123+
dev->stats.tx_errors++;
124+
goto free;
125+
}
126+
120127
/* set txpd fields from the radiotap header */
121128
txpd->tx_control = cpu_to_le32(convert_radiotap_rate_to_mv(rtap_hdr->rate));
122129

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static void lbtf_free_adapter(struct lbtf_private *priv)
174174
{
175175
lbtf_deb_enter(LBTF_DEB_MAIN);
176176
lbtf_free_cmd_buffer(priv);
177-
timer_delete(&priv->command_timer);
177+
timer_delete_sync(&priv->command_timer);
178178
lbtf_deb_leave(LBTF_DEB_MAIN);
179179
}
180180

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4334,7 +4334,7 @@ mwifiex_cfg80211_authenticate(struct wiphy *wiphy,
43344334
return -EOPNOTSUPP;
43354335
}
43364336

4337-
if (!priv->auth_flag) {
4337+
if (!(priv->auth_flag & HOST_MLME_AUTH_PENDING)) {
43384338
ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_SET,
43394339
req->bss->channel,
43404340
AUTH_TX_DEFAULT_WAIT_TIME);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,6 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
736736
/* Send a Media Connected event, according to the Spec */
737737
priv->media_connected = true;
738738

739-
priv->adapter->ps_state = PS_STATE_AWAKE;
740739
priv->adapter->pps_uapsd_mode = false;
741740
priv->adapter->tx_lock_flag = false;
742741

0 commit comments

Comments
 (0)