Skip to content

Commit 8b97cae

Browse files
committed
Merge tag 'net-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from wireless and netfilter. Current release - regressions: - dsa: lantiq_gswip: fix use after free in gswip_remove() - smc: avoid overwriting the copies of clcsock callback functions Current release - new code bugs: - iwlwifi: - fix use-after-free when no FW is present - mei: fix the pskb_may_pull check in ipv4 - mei: retry mapping the shared area - mvm: don't feed the hardware RFKILL into iwlmei Previous releases - regressions: - ipv6: mcast: use rcu-safe version of ipv6_get_lladdr() - tipc: fix wrong publisher node address in link publications - iwlwifi: mvm: don't send SAR GEO command for 3160 devices, avoid FW assertion - bgmac: make idm and nicpm resource optional again - atl1c: fix tx timeout after link flap Previous releases - always broken: - vsock: remove vsock from connected table when connect is interrupted by a signal - ping: change destination interface checks to match raw sockets - crypto: af_alg - get rid of alg_memory_allocated to avoid confusing semantics (and null-deref) after SO_RESERVE_MEM was added - ipv6: make exclusive flowlabel checks per-netns - bonding: force carrier update when releasing slave - sched: limit TC_ACT_REPEAT loops - bridge: multicast: notify switchdev driver whenever MC processing gets disabled because of max entries reached - wifi: brcmfmac: fix crash in brcm_alt_fw_path when WLAN not found - iwlwifi: fix locking when "HW not ready" - phy: mediatek: remove PHY mode check on MT7531 - dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN - dsa: lan9303: - fix polarity of reset during probe - fix accelerated VLAN handling" * tag 'net-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (65 commits) bonding: force carrier update when releasing slave nfp: flower: netdev offload check for ip6gretap ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt ipv4: fix data races in fib_alias_hw_flags_set net: dsa: lan9303: add VLAN IDs to master device net: dsa: lan9303: handle hwaccel VLAN tags vsock: remove vsock from connected table when connect is interrupted by a signal Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname" ping: fix the dif and sdif check in ping_lookup net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990 net: sched: limit TC_ACT_REPEAT loops tipc: fix wrong notification node addresses net: dsa: lantiq_gswip: fix use after free in gswip_remove() ipv6: per-netns exclusive flowlabel checks net: bridge: multicast: notify switchdev driver whenever MC processing gets disabled CDC-NCM: avoid overflow in sanity checking mctp: fix use after free net: mscc: ocelot: fix use-after-free in ocelot_vlan_del() bonding: fix data-races around agg_select_timer dpaa2-eth: Initialize mutex used in one step timestamping path ...
2 parents a3580ac + a6ab75c commit 8b97cae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+520
-788
lines changed

MAINTAINERS

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3139,11 +3139,9 @@ W: https://wireless.wiki.kernel.org/en/users/Drivers/ath5k
31393139
F: drivers/net/wireless/ath/ath5k/
31403140

31413141
ATHEROS ATH6KL WIRELESS DRIVER
3142-
M: Kalle Valo <[email protected]>
31433142
3144-
S: Supported
3143+
S: Orphan
31453144
W: https://wireless.wiki.kernel.org/en/users/Drivers/ath6kl
3146-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
31473145
F: drivers/net/wireless/ath/ath6kl/
31483146

31493147
ATI_REMOTE2 DRIVER
@@ -7188,7 +7186,7 @@ F: drivers/net/can/usb/etas_es58x/
71887186

71897187
ETHERNET BRIDGE
71907188
M: Roopa Prabhu <[email protected]>
7191-
M: Nikolay Aleksandrov <[email protected]>
7189+
M: Nikolay Aleksandrov <[email protected]>
71927190
L: [email protected] (moderated for non-subscribers)
71937191
71947192
S: Maintained
@@ -15912,18 +15910,20 @@ S: Supported
1591215910
W: https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
1591315911
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
1591415912
F: drivers/net/wireless/ath/ath10k/
15913+
F: Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
1591515914

1591615915
QUALCOMM ATHEROS ATH11K WIRELESS DRIVER
1591715916
M: Kalle Valo <[email protected]>
1591815917
1591915918
S: Supported
1592015919
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
1592115920
F: drivers/net/wireless/ath/ath11k/
15921+
F: Documentation/devicetree/bindings/net/wireless/qcom,ath11k.txt
1592215922

1592315923
QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
15924-
15924+
M: Toke Høiland-Jørgensen <[email protected]>
1592515925
15926-
S: Supported
15926+
S: Maintained
1592715927
W: https://wireless.wiki.kernel.org/en/users/Drivers/ath9k
1592815928
F: Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
1592915929
F: drivers/net/wireless/ath/ath9k/
@@ -16104,11 +16104,10 @@ F: Documentation/devicetree/bindings/media/*venus*
1610416104
F: drivers/media/platform/qcom/venus/
1610516105

1610616106
QUALCOMM WCN36XX WIRELESS DRIVER
16107-
M: Kalle Valo <kvalo@kernel.org>
16107+
M: Loic Poulain <loic.poulain@linaro.org>
1610816108
1610916109
S: Supported
1611016110
W: https://wireless.wiki.kernel.org/en/users/Drivers/wcn36xx
16111-
T: git git://github.com/KrasnikovEugene/wcn36xx.git
1611216111
F: drivers/net/wireless/ath/wcn36xx/
1611316112

1611416113
QUANTENNA QTNFMAC WIRELESS DRIVER

crypto/af_alg.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ struct alg_type_list {
2525
struct list_head list;
2626
};
2727

28-
static atomic_long_t alg_memory_allocated;
29-
3028
static struct proto alg_proto = {
3129
.name = "ALG",
3230
.owner = THIS_MODULE,
33-
.memory_allocated = &alg_memory_allocated,
3431
.obj_size = sizeof(struct alg_sock),
3532
};
3633

drivers/net/bonding/bond_3ad.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static inline int __check_agg_selection_timer(struct port *port)
225225
if (bond == NULL)
226226
return 0;
227227

228-
return BOND_AD_INFO(bond).agg_select_timer ? 1 : 0;
228+
return atomic_read(&BOND_AD_INFO(bond).agg_select_timer) ? 1 : 0;
229229
}
230230

231231
/**
@@ -1995,7 +1995,7 @@ static void ad_marker_response_received(struct bond_marker *marker,
19951995
*/
19961996
void bond_3ad_initiate_agg_selection(struct bonding *bond, int timeout)
19971997
{
1998-
BOND_AD_INFO(bond).agg_select_timer = timeout;
1998+
atomic_set(&BOND_AD_INFO(bond).agg_select_timer, timeout);
19991999
}
20002000

20012001
/**
@@ -2278,6 +2278,28 @@ void bond_3ad_update_ad_actor_settings(struct bonding *bond)
22782278
spin_unlock_bh(&bond->mode_lock);
22792279
}
22802280

2281+
/**
2282+
* bond_agg_timer_advance - advance agg_select_timer
2283+
* @bond: bonding structure
2284+
*
2285+
* Return true when agg_select_timer reaches 0.
2286+
*/
2287+
static bool bond_agg_timer_advance(struct bonding *bond)
2288+
{
2289+
int val, nval;
2290+
2291+
while (1) {
2292+
val = atomic_read(&BOND_AD_INFO(bond).agg_select_timer);
2293+
if (!val)
2294+
return false;
2295+
nval = val - 1;
2296+
if (atomic_cmpxchg(&BOND_AD_INFO(bond).agg_select_timer,
2297+
val, nval) == val)
2298+
break;
2299+
}
2300+
return nval == 0;
2301+
}
2302+
22812303
/**
22822304
* bond_3ad_state_machine_handler - handle state machines timeout
22832305
* @work: work context to fetch bonding struct to work on from
@@ -2313,9 +2335,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
23132335
if (!bond_has_slaves(bond))
23142336
goto re_arm;
23152337

2316-
/* check if agg_select_timer timer after initialize is timed out */
2317-
if (BOND_AD_INFO(bond).agg_select_timer &&
2318-
!(--BOND_AD_INFO(bond).agg_select_timer)) {
2338+
if (bond_agg_timer_advance(bond)) {
23192339
slave = bond_first_slave_rcu(bond);
23202340
port = slave ? &(SLAVE_AD_INFO(slave)->port) : NULL;
23212341

drivers/net/bonding/bond_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,10 +2379,9 @@ static int __bond_release_one(struct net_device *bond_dev,
23792379
bond_select_active_slave(bond);
23802380
}
23812381

2382-
if (!bond_has_slaves(bond)) {
2383-
bond_set_carrier(bond);
2382+
bond_set_carrier(bond);
2383+
if (!bond_has_slaves(bond))
23842384
eth_hw_addr_random(bond_dev);
2385-
}
23862385

23872386
unblock_netpoll_tx();
23882387
synchronize_rcu();

drivers/net/dsa/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ config NET_DSA_REALTEK_SMI
8282

8383
config NET_DSA_SMSC_LAN9303
8484
tristate
85+
depends on VLAN_8021Q || VLAN_8021Q=n
8586
select NET_DSA_TAG_LAN9303
8687
select REGMAP
8788
help

drivers/net/dsa/lan9303-core.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/mii.h>
1111
#include <linux/phy.h>
1212
#include <linux/if_bridge.h>
13+
#include <linux/if_vlan.h>
1314
#include <linux/etherdevice.h>
1415

1516
#include "lan9303.h"
@@ -1083,21 +1084,27 @@ static void lan9303_adjust_link(struct dsa_switch *ds, int port,
10831084
static int lan9303_port_enable(struct dsa_switch *ds, int port,
10841085
struct phy_device *phy)
10851086
{
1087+
struct dsa_port *dp = dsa_to_port(ds, port);
10861088
struct lan9303 *chip = ds->priv;
10871089

1088-
if (!dsa_is_user_port(ds, port))
1090+
if (!dsa_port_is_user(dp))
10891091
return 0;
10901092

1093+
vlan_vid_add(dp->cpu_dp->master, htons(ETH_P_8021Q), port);
1094+
10911095
return lan9303_enable_processing_port(chip, port);
10921096
}
10931097

10941098
static void lan9303_port_disable(struct dsa_switch *ds, int port)
10951099
{
1100+
struct dsa_port *dp = dsa_to_port(ds, port);
10961101
struct lan9303 *chip = ds->priv;
10971102

1098-
if (!dsa_is_user_port(ds, port))
1103+
if (!dsa_port_is_user(dp))
10991104
return;
11001105

1106+
vlan_vid_del(dp->cpu_dp->master, htons(ETH_P_8021Q), port);
1107+
11011108
lan9303_disable_processing_port(chip, port);
11021109
lan9303_phy_write(ds, chip->phy_addr_base + port, MII_BMCR, BMCR_PDOWN);
11031110
}
@@ -1310,7 +1317,7 @@ static int lan9303_probe_reset_gpio(struct lan9303 *chip,
13101317
struct device_node *np)
13111318
{
13121319
chip->reset_gpio = devm_gpiod_get_optional(chip->dev, "reset",
1313-
GPIOD_OUT_LOW);
1320+
GPIOD_OUT_HIGH);
13141321
if (IS_ERR(chip->reset_gpio))
13151322
return PTR_ERR(chip->reset_gpio);
13161323

drivers/net/dsa/lantiq_gswip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,8 +2176,8 @@ static int gswip_remove(struct platform_device *pdev)
21762176

21772177
if (priv->ds->slave_mii_bus) {
21782178
mdiobus_unregister(priv->ds->slave_mii_bus);
2179-
mdiobus_free(priv->ds->slave_mii_bus);
21802179
of_node_put(priv->ds->slave_mii_bus->dev.of_node);
2180+
mdiobus_free(priv->ds->slave_mii_bus);
21812181
}
21822182

21832183
for (i = 0; i < priv->num_gphy_fw; i++)

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,6 +2284,13 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port,
22842284
if (!mv88e6xxx_max_vid(chip))
22852285
return -EOPNOTSUPP;
22862286

2287+
/* The ATU removal procedure needs the FID to be mapped in the VTU,
2288+
* but FDB deletion runs concurrently with VLAN deletion. Flush the DSA
2289+
* switchdev workqueue to ensure that all FDB entries are deleted
2290+
* before we remove the VLAN.
2291+
*/
2292+
dsa_flush_workqueue();
2293+
22872294
mv88e6xxx_reg_lock(chip);
22882295

22892296
err = mv88e6xxx_port_get_pvid(chip, port, &pvid);

drivers/net/ethernet/atheros/atl1c/atl1c_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static void atl1c_clean_tx_ring(struct atl1c_adapter *adapter,
900900
atl1c_clean_buffer(pdev, buffer_info);
901901
}
902902

903-
netdev_reset_queue(adapter->netdev);
903+
netdev_tx_reset_queue(netdev_get_tx_queue(adapter->netdev, queue));
904904

905905
/* Zero out Tx-buffers */
906906
memset(tpd_ring->desc, 0, sizeof(struct atl1c_tpd_desc) *

drivers/net/ethernet/broadcom/bgmac-platform.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ static int bgmac_probe(struct platform_device *pdev)
172172
{
173173
struct device_node *np = pdev->dev.of_node;
174174
struct bgmac *bgmac;
175+
struct resource *regs;
175176
int ret;
176177

177178
bgmac = bgmac_alloc(&pdev->dev);
@@ -208,15 +209,23 @@ static int bgmac_probe(struct platform_device *pdev)
208209
if (IS_ERR(bgmac->plat.base))
209210
return PTR_ERR(bgmac->plat.base);
210211

211-
bgmac->plat.idm_base = devm_platform_ioremap_resource_byname(pdev, "idm_base");
212-
if (IS_ERR(bgmac->plat.idm_base))
213-
return PTR_ERR(bgmac->plat.idm_base);
214-
else
212+
/* The idm_base resource is optional for some platforms */
213+
regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "idm_base");
214+
if (regs) {
215+
bgmac->plat.idm_base = devm_ioremap_resource(&pdev->dev, regs);
216+
if (IS_ERR(bgmac->plat.idm_base))
217+
return PTR_ERR(bgmac->plat.idm_base);
215218
bgmac->feature_flags &= ~BGMAC_FEAT_IDM_MASK;
219+
}
216220

217-
bgmac->plat.nicpm_base = devm_platform_ioremap_resource_byname(pdev, "nicpm_base");
218-
if (IS_ERR(bgmac->plat.nicpm_base))
219-
return PTR_ERR(bgmac->plat.nicpm_base);
221+
/* The nicpm_base resource is optional for some platforms */
222+
regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nicpm_base");
223+
if (regs) {
224+
bgmac->plat.nicpm_base = devm_ioremap_resource(&pdev->dev,
225+
regs);
226+
if (IS_ERR(bgmac->plat.nicpm_base))
227+
return PTR_ERR(bgmac->plat.nicpm_base);
228+
}
220229

221230
bgmac->read = platform_bgmac_read;
222231
bgmac->write = platform_bgmac_write;

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4338,7 +4338,7 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
43384338
}
43394339

43404340
INIT_WORK(&priv->tx_onestep_tstamp, dpaa2_eth_tx_onestep_tstamp);
4341-
4341+
mutex_init(&priv->onestep_tstamp_lock);
43424342
skb_queue_head_init(&priv->tx_skbs);
43434343

43444344
priv->rx_copybreak = DPAA2_ETH_DEFAULT_COPYBREAK;

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ static int dpaa2_switch_flower_parse_mirror_key(struct flow_cls_offload *cls,
532532
struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
533533
struct flow_dissector *dissector = rule->match.dissector;
534534
struct netlink_ext_ack *extack = cls->common.extack;
535+
int ret = -EOPNOTSUPP;
535536

536537
if (dissector->used_keys &
537538
~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
@@ -561,9 +562,10 @@ static int dpaa2_switch_flower_parse_mirror_key(struct flow_cls_offload *cls,
561562
}
562563

563564
*vlan = (u16)match.key->vlan_id;
565+
ret = 0;
564566
}
565567

566-
return 0;
568+
return ret;
567569
}
568570

569571
static int

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,12 @@ static void ice_vsi_set_rss_flow_fld(struct ice_vsi *vsi)
16841684
if (status)
16851685
dev_dbg(dev, "ice_add_rss_cfg failed for sctp6 flow, vsi = %d, error = %d\n",
16861686
vsi_num, status);
1687+
1688+
status = ice_add_rss_cfg(hw, vsi_handle, ICE_FLOW_HASH_ESP_SPI,
1689+
ICE_FLOW_SEG_HDR_ESP);
1690+
if (status)
1691+
dev_dbg(dev, "ice_add_rss_cfg failed for esp/spi flow, vsi = %d, error = %d\n",
1692+
vsi_num, status);
16871693
}
16881694

16891695
/**

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,14 +549,18 @@ EXPORT_SYMBOL(ocelot_vlan_add);
549549
int ocelot_vlan_del(struct ocelot *ocelot, int port, u16 vid)
550550
{
551551
struct ocelot_port *ocelot_port = ocelot->ports[port];
552+
bool del_pvid = false;
552553
int err;
553554

555+
if (ocelot_port->pvid_vlan && ocelot_port->pvid_vlan->vid == vid)
556+
del_pvid = true;
557+
554558
err = ocelot_vlan_member_del(ocelot, port, vid);
555559
if (err)
556560
return err;
557561

558562
/* Ingress */
559-
if (ocelot_port->pvid_vlan && ocelot_port->pvid_vlan->vid == vid)
563+
if (del_pvid)
560564
ocelot_port_set_pvid(ocelot, port, NULL);
561565

562566
/* Egress */

drivers/net/ethernet/netronome/nfp/flower/cmsg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,8 @@ static inline bool nfp_fl_is_netdev_to_offload(struct net_device *netdev)
723723
return true;
724724
if (netif_is_gretap(netdev))
725725
return true;
726+
if (netif_is_ip6gretap(netdev))
727+
return true;
726728

727729
return false;
728730
}

drivers/net/ieee802154/ca8210.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,8 +2975,8 @@ static void ca8210_hw_setup(struct ieee802154_hw *ca8210_hw)
29752975
ca8210_hw->phy->cca.opt = NL802154_CCA_OPT_ENERGY_CARRIER_AND;
29762976
ca8210_hw->phy->cca_ed_level = -9800;
29772977
ca8210_hw->phy->symbol_duration = 16;
2978-
ca8210_hw->phy->lifs_period = 40;
2979-
ca8210_hw->phy->sifs_period = 12;
2978+
ca8210_hw->phy->lifs_period = 40 * ca8210_hw->phy->symbol_duration;
2979+
ca8210_hw->phy->sifs_period = 12 * ca8210_hw->phy->symbol_duration;
29802980
ca8210_hw->flags =
29812981
IEEE802154_HW_AFILT |
29822982
IEEE802154_HW_OMIT_CKSUM |

drivers/net/mctp/mctp-serial.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,16 @@ static void mctp_serial_tty_receive_buf(struct tty_struct *tty,
403403
mctp_serial_push(dev, c[i]);
404404
}
405405

406+
static void mctp_serial_uninit(struct net_device *ndev)
407+
{
408+
struct mctp_serial *dev = netdev_priv(ndev);
409+
410+
cancel_work_sync(&dev->tx_work);
411+
}
412+
406413
static const struct net_device_ops mctp_serial_netdev_ops = {
407414
.ndo_start_xmit = mctp_serial_tx,
415+
.ndo_uninit = mctp_serial_uninit,
408416
};
409417

410418
static void mctp_serial_setup(struct net_device *ndev)
@@ -483,7 +491,6 @@ static void mctp_serial_close(struct tty_struct *tty)
483491
int idx = dev->idx;
484492

485493
unregister_netdev(dev->netdev);
486-
cancel_work_sync(&dev->tx_work);
487494
ida_free(&mctp_serial_ida, idx);
488495
}
489496

drivers/net/netdevsim/fib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,14 @@ static int nsim_fib6_rt_append(struct nsim_fib_data *data,
623623
if (err)
624624
goto err_fib6_rt_nh_del;
625625

626-
fib6_event->rt_arr[i]->trap = true;
626+
WRITE_ONCE(fib6_event->rt_arr[i]->trap, true);
627627
}
628628

629629
return 0;
630630

631631
err_fib6_rt_nh_del:
632632
for (i--; i >= 0; i--) {
633-
fib6_event->rt_arr[i]->trap = false;
633+
WRITE_ONCE(fib6_event->rt_arr[i]->trap, false);
634634
nsim_fib6_rt_nh_del(fib6_rt, fib6_event->rt_arr[i]);
635635
}
636636
return err;

0 commit comments

Comments
 (0)