Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'net-6.3-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Jakub Kicinski:
"Including fixes from wireless and can.

Current release - regressions:

- wifi: mac80211:
- fix potential null pointer dereference
- fix receiving mesh packets in forwarding=0 networks
- fix mesh forwarding

Current release - new code bugs:

- virtio/vsock: fix leaks due to missing skb owner

Previous releases - regressions:

- raw: fix NULL deref in raw_get_next().

- sctp: check send stream number after wait_for_sndbuf

- qrtr:
- fix a refcount bug in qrtr_recvmsg()
- do not do DEL_SERVER broadcast after DEL_CLIENT

- wifi: brcmfmac: fix SDIO suspend/resume regression

- wifi: mt76: fix use-after-free in fw features query.

- can: fix race between isotp_sendsmg() and isotp_release()

- eth: mtk_eth_soc: fix remaining throughput regression

- eth: ice: reset FDIR counter in FDIR init stage

Previous releases - always broken:

- core: don't let netpoll invoke NAPI if in xmit context

- icmp: guard against too small mtu

- ipv6: fix an uninit variable access bug in __ip6_make_skb()

- wifi: mac80211: fix the size calculation of
ieee80211_ie_len_eht_cap()

- can: fix poll() to not report false EPOLLOUT events

- eth: gve: secure enough bytes in the first TX desc for all TCP
pkts"

* tag 'net-6.3-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (47 commits)
net: stmmac: check fwnode for phy device before scanning for phy
net: stmmac: Add queue reset into stmmac_xdp_open() function
selftests: net: rps_default_mask.sh: delete veth link specifically
net: fec: make use of MDIO C45 quirk
can: isotp: fix race between isotp_sendsmg() and isotp_release()
can: isotp: isotp_ops: fix poll() to not report false EPOLLOUT events
can: isotp: isotp_recvmsg(): use sock_recv_cmsgs() to get SOCK_RXQ_OVFL infos
can: j1939: j1939_tp_tx_dat_new(): fix out-of-bounds memory access
gve: Secure enough bytes in the first TX desc for all TCP pkts
netlink: annotate lockless accesses to nlk->max_recvmsg_len
ethtool: reset #lanes when lanes is omitted
ping: Fix potentail NULL deref for /proc/net/icmp.
raw: Fix NULL deref in raw_get_next().
ice: Reset FDIR counter in FDIR init stage
ice: fix wrong fallback logic for FDIR
net: stmmac: fix up RX flow hash indirection table when setting channels
net: ethernet: ti: am65-cpsw: Fix mdio cleanup in probe
wifi: mt76: ignore key disable commands
wifi: ath11k: reduce the MHI timeout to 20s
ipv6: Fix an uninit variable access bug in __ip6_make_skb()
...

+408 -244
+1 -1
drivers/net/dsa/mv88e6xxx/chip.c
··· 5601 5601 * .port_set_upstream_port method. 5602 5602 */ 5603 5603 .set_egress_port = mv88e6393x_set_egress_port, 5604 - .watchdog_ops = &mv88e6390_watchdog_ops, 5604 + .watchdog_ops = &mv88e6393x_watchdog_ops, 5605 5605 .mgmt_rsvd2cpu = mv88e6393x_port_mgmt_rsvd2cpu, 5606 5606 .pot_clear = mv88e6xxx_g2_pot_clear, 5607 5607 .reset = mv88e6352_g1_reset,
+20
drivers/net/dsa/mv88e6xxx/global2.c
··· 943 943 .irq_free = mv88e6390_watchdog_free, 944 944 }; 945 945 946 + static int mv88e6393x_watchdog_action(struct mv88e6xxx_chip *chip, int irq) 947 + { 948 + mv88e6390_watchdog_action(chip, irq); 949 + 950 + /* Fix for clearing the force WD event bit. 951 + * Unreleased erratum on mv88e6393x. 952 + */ 953 + mv88e6xxx_g2_write(chip, MV88E6390_G2_WDOG_CTL, 954 + MV88E6390_G2_WDOG_CTL_UPDATE | 955 + MV88E6390_G2_WDOG_CTL_PTR_EVENT); 956 + 957 + return IRQ_HANDLED; 958 + } 959 + 960 + const struct mv88e6xxx_irq_ops mv88e6393x_watchdog_ops = { 961 + .irq_action = mv88e6393x_watchdog_action, 962 + .irq_setup = mv88e6390_watchdog_setup, 963 + .irq_free = mv88e6390_watchdog_free, 964 + }; 965 + 946 966 static irqreturn_t mv88e6xxx_g2_watchdog_thread_fn(int irq, void *dev_id) 947 967 { 948 968 struct mv88e6xxx_chip *chip = dev_id;
+1
drivers/net/dsa/mv88e6xxx/global2.h
··· 369 369 extern const struct mv88e6xxx_irq_ops mv88e6097_watchdog_ops; 370 370 extern const struct mv88e6xxx_irq_ops mv88e6250_watchdog_ops; 371 371 extern const struct mv88e6xxx_irq_ops mv88e6390_watchdog_ops; 372 + extern const struct mv88e6xxx_irq_ops mv88e6393x_watchdog_ops; 372 373 373 374 extern const struct mv88e6xxx_avb_ops mv88e6165_avb_ops; 374 375 extern const struct mv88e6xxx_avb_ops mv88e6352_avb_ops;
+5
drivers/net/ethernet/freescale/fec.h
··· 507 507 /* i.MX6Q adds pm_qos support */ 508 508 #define FEC_QUIRK_HAS_PMQOS BIT(23) 509 509 510 + /* Not all FEC hardware block MDIOs support accesses in C45 mode. 511 + * Older blocks in the ColdFire parts do not support it. 512 + */ 513 + #define FEC_QUIRK_HAS_MDIO_C45 BIT(24) 514 + 510 515 struct bufdesc_prop { 511 516 int qid; 512 517 /* Address of Rx and Tx buffers */
+20 -12
drivers/net/ethernet/freescale/fec_main.c
··· 100 100 101 101 static const struct fec_devinfo fec_imx25_info = { 102 102 .quirks = FEC_QUIRK_USE_GASKET | FEC_QUIRK_MIB_CLEAR | 103 - FEC_QUIRK_HAS_FRREG, 103 + FEC_QUIRK_HAS_FRREG | FEC_QUIRK_HAS_MDIO_C45, 104 104 }; 105 105 106 106 static const struct fec_devinfo fec_imx27_info = { 107 - .quirks = FEC_QUIRK_MIB_CLEAR | FEC_QUIRK_HAS_FRREG, 107 + .quirks = FEC_QUIRK_MIB_CLEAR | FEC_QUIRK_HAS_FRREG | 108 + FEC_QUIRK_HAS_MDIO_C45, 108 109 }; 109 110 110 111 static const struct fec_devinfo fec_imx28_info = { 111 112 .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME | 112 113 FEC_QUIRK_SINGLE_MDIO | FEC_QUIRK_HAS_RACC | 113 114 FEC_QUIRK_HAS_FRREG | FEC_QUIRK_CLEAR_SETUP_MII | 114 - FEC_QUIRK_NO_HARD_RESET, 115 + FEC_QUIRK_NO_HARD_RESET | FEC_QUIRK_HAS_MDIO_C45, 115 116 }; 116 117 117 118 static const struct fec_devinfo fec_imx6q_info = { ··· 120 119 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 121 120 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358 | 122 121 FEC_QUIRK_HAS_RACC | FEC_QUIRK_CLEAR_SETUP_MII | 123 - FEC_QUIRK_HAS_PMQOS, 122 + FEC_QUIRK_HAS_PMQOS | FEC_QUIRK_HAS_MDIO_C45, 124 123 }; 125 124 126 125 static const struct fec_devinfo fec_mvf600_info = { 127 - .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_RACC, 126 + .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_RACC | 127 + FEC_QUIRK_HAS_MDIO_C45, 128 128 }; 129 129 130 130 static const struct fec_devinfo fec_imx6x_info = { ··· 134 132 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB | 135 133 FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE | 136 134 FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE | 137 - FEC_QUIRK_CLEAR_SETUP_MII | FEC_QUIRK_HAS_MULTI_QUEUES, 135 + FEC_QUIRK_CLEAR_SETUP_MII | FEC_QUIRK_HAS_MULTI_QUEUES | 136 + FEC_QUIRK_HAS_MDIO_C45, 138 137 }; 139 138 140 139 static const struct fec_devinfo fec_imx6ul_info = { ··· 143 140 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 144 141 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR007885 | 145 142 FEC_QUIRK_BUG_CAPTURE | FEC_QUIRK_HAS_RACC | 146 - FEC_QUIRK_HAS_COALESCE | FEC_QUIRK_CLEAR_SETUP_MII, 143 + FEC_QUIRK_HAS_COALESCE | FEC_QUIRK_CLEAR_SETUP_MII | 144 + FEC_QUIRK_HAS_MDIO_C45, 147 145 }; 148 146 149 147 static const struct fec_devinfo fec_imx8mq_info = { ··· 154 150 FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE | 155 151 FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE | 156 152 FEC_QUIRK_CLEAR_SETUP_MII | FEC_QUIRK_HAS_MULTI_QUEUES | 157 - FEC_QUIRK_HAS_EEE | FEC_QUIRK_WAKEUP_FROM_INT2, 153 + FEC_QUIRK_HAS_EEE | FEC_QUIRK_WAKEUP_FROM_INT2 | 154 + FEC_QUIRK_HAS_MDIO_C45, 158 155 }; 159 156 160 157 static const struct fec_devinfo fec_imx8qm_info = { ··· 165 160 FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE | 166 161 FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE | 167 162 FEC_QUIRK_CLEAR_SETUP_MII | FEC_QUIRK_HAS_MULTI_QUEUES | 168 - FEC_QUIRK_DELAYED_CLKS_SUPPORT, 163 + FEC_QUIRK_DELAYED_CLKS_SUPPORT | FEC_QUIRK_HAS_MDIO_C45, 169 164 }; 170 165 171 166 static const struct fec_devinfo fec_s32v234_info = { 172 167 .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 173 168 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 174 169 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB | 175 - FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE, 170 + FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE | 171 + FEC_QUIRK_HAS_MDIO_C45, 176 172 }; 177 173 178 174 static struct platform_device_id fec_devtype[] = { ··· 2440 2434 fep->mii_bus->name = "fec_enet_mii_bus"; 2441 2435 fep->mii_bus->read = fec_enet_mdio_read_c22; 2442 2436 fep->mii_bus->write = fec_enet_mdio_write_c22; 2443 - fep->mii_bus->read_c45 = fec_enet_mdio_read_c45; 2444 - fep->mii_bus->write_c45 = fec_enet_mdio_write_c45; 2437 + if (fep->quirks & FEC_QUIRK_HAS_MDIO_C45) { 2438 + fep->mii_bus->read_c45 = fec_enet_mdio_read_c45; 2439 + fep->mii_bus->write_c45 = fec_enet_mdio_write_c45; 2440 + } 2445 2441 snprintf(fep->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", 2446 2442 pdev->name, fep->dev_id + 1); 2447 2443 fep->mii_bus->priv = fep;
+2
drivers/net/ethernet/google/gve/gve.h
··· 47 47 48 48 #define GVE_RX_BUFFER_SIZE_DQO 2048 49 49 50 + #define GVE_GQ_TX_MIN_PKT_DESC_BYTES 182 51 + 50 52 /* Each slot in the desc ring has a 1:1 mapping to a slot in the data ring */ 51 53 struct gve_rx_desc_queue { 52 54 struct gve_rx_desc *desc_ring; /* the descriptor ring */
+5 -7
drivers/net/ethernet/google/gve/gve_tx.c
··· 284 284 int bytes; 285 285 int hlen; 286 286 287 - hlen = skb_is_gso(skb) ? skb_checksum_start_offset(skb) + 288 - tcp_hdrlen(skb) : skb_headlen(skb); 287 + hlen = skb_is_gso(skb) ? skb_checksum_start_offset(skb) + tcp_hdrlen(skb) : 288 + min_t(int, GVE_GQ_TX_MIN_PKT_DESC_BYTES, skb->len); 289 289 290 290 pad_bytes = gve_tx_fifo_pad_alloc_one_frag(&tx->tx_fifo, 291 291 hlen); ··· 454 454 pkt_desc = &tx->desc[idx]; 455 455 456 456 l4_hdr_offset = skb_checksum_start_offset(skb); 457 - /* If the skb is gso, then we want the tcp header in the first segment 458 - * otherwise we want the linear portion of the skb (which will contain 459 - * the checksum because skb->csum_start and skb->csum_offset are given 460 - * relative to skb->head) in the first segment. 457 + /* If the skb is gso, then we want the tcp header alone in the first segment 458 + * otherwise we want the minimum required by the gVNIC spec. 461 459 */ 462 460 hlen = is_gso ? l4_hdr_offset + tcp_hdrlen(skb) : 463 - skb_headlen(skb); 461 + min_t(int, GVE_GQ_TX_MIN_PKT_DESC_BYTES, skb->len); 464 462 465 463 info->skb = skb; 466 464 /* We don't want to split the header, so if necessary, pad to the end
+20 -3
drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
··· 542 542 } 543 543 544 544 /** 545 + * ice_vc_fdir_reset_cnt_all - reset all FDIR counters for this VF FDIR 546 + * @fdir: pointer to the VF FDIR structure 547 + */ 548 + static void ice_vc_fdir_reset_cnt_all(struct ice_vf_fdir *fdir) 549 + { 550 + enum ice_fltr_ptype flow; 551 + 552 + for (flow = ICE_FLTR_PTYPE_NONF_NONE; 553 + flow < ICE_FLTR_PTYPE_MAX; flow++) { 554 + fdir->fdir_fltr_cnt[flow][0] = 0; 555 + fdir->fdir_fltr_cnt[flow][1] = 0; 556 + } 557 + } 558 + 559 + /** 545 560 * ice_vc_fdir_has_prof_conflict 546 561 * @vf: pointer to the VF structure 547 562 * @conf: FDIR configuration for each filter ··· 1886 1871 v_ret = VIRTCHNL_STATUS_SUCCESS; 1887 1872 stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE; 1888 1873 dev_dbg(dev, "VF %d: set FDIR context failed\n", vf->vf_id); 1889 - goto err_free_conf; 1874 + goto err_rem_entry; 1890 1875 } 1891 1876 1892 1877 ret = ice_vc_fdir_write_fltr(vf, conf, true, is_tun); ··· 1895 1880 stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE; 1896 1881 dev_err(dev, "VF %d: writing FDIR rule failed, ret:%d\n", 1897 1882 vf->vf_id, ret); 1898 - goto err_rem_entry; 1883 + goto err_clr_irq; 1899 1884 } 1900 1885 1901 1886 exit: 1902 1887 kfree(stat); 1903 1888 return ret; 1904 1889 1905 - err_rem_entry: 1890 + err_clr_irq: 1906 1891 ice_vc_fdir_clear_irq_ctx(vf); 1892 + err_rem_entry: 1907 1893 ice_vc_fdir_remove_entry(vf, conf, conf->flow_id); 1908 1894 err_free_conf: 1909 1895 devm_kfree(dev, conf); ··· 2013 1997 spin_lock_init(&fdir->ctx_lock); 2014 1998 fdir->ctx_irq.flags = 0; 2015 1999 fdir->ctx_done.flags = 0; 2000 + ice_vc_fdir_reset_cnt_all(fdir); 2016 2001 } 2017 2002 2018 2003 /**
+4
drivers/net/ethernet/mediatek/mtk_eth_soc.c
··· 753 753 MAC_MCR_FORCE_RX_FC); 754 754 755 755 /* Configure speed */ 756 + mac->speed = speed; 756 757 switch (speed) { 757 758 case SPEED_2500: 758 759 case SPEED_1000: ··· 3235 3234 dp = dsa_port_from_netdev(dev); 3236 3235 if (dp->index >= MTK_QDMA_NUM_QUEUES) 3237 3236 return NOTIFY_DONE; 3237 + 3238 + if (mac->speed > 0 && mac->speed <= s.base.speed) 3239 + s.base.speed = 0; 3238 3240 3239 3241 mtk_set_queue_speed(eth, dp->index + 3, s.base.speed); 3240 3242
-1
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
··· 251 251 priv->plat->mdio_bus_data->xpcs_an_inband = false; 252 252 } else { 253 253 priv->plat->max_speed = 1000; 254 - priv->plat->mdio_bus_data->xpcs_an_inband = true; 255 254 } 256 255 } 257 256
+18 -3
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1134 1134 static int stmmac_init_phy(struct net_device *dev) 1135 1135 { 1136 1136 struct stmmac_priv *priv = netdev_priv(dev); 1137 + struct fwnode_handle *phy_fwnode; 1137 1138 struct fwnode_handle *fwnode; 1138 1139 int ret; 1140 + 1141 + if (!phylink_expects_phy(priv->phylink)) 1142 + return 0; 1139 1143 1140 1144 fwnode = of_fwnode_handle(priv->plat->phylink_node); 1141 1145 if (!fwnode) 1142 1146 fwnode = dev_fwnode(priv->device); 1143 1147 1144 1148 if (fwnode) 1145 - ret = phylink_fwnode_phy_connect(priv->phylink, fwnode, 0); 1149 + phy_fwnode = fwnode_get_phy_node(fwnode); 1150 + else 1151 + phy_fwnode = NULL; 1146 1152 1147 1153 /* Some DT bindings do not set-up the PHY handle. Let's try to 1148 1154 * manually parse it 1149 1155 */ 1150 - if (!fwnode || ret) { 1156 + if (!phy_fwnode || IS_ERR(phy_fwnode)) { 1151 1157 int addr = priv->plat->phy_addr; 1152 1158 struct phy_device *phydev; 1153 1159 ··· 1169 1163 } 1170 1164 1171 1165 ret = phylink_connect_phy(priv->phylink, phydev); 1166 + } else { 1167 + fwnode_handle_put(phy_fwnode); 1168 + ret = phylink_fwnode_phy_connect(priv->phylink, fwnode, 0); 1172 1169 } 1173 1170 1174 1171 if (!priv->plat->pmt) { ··· 6631 6622 goto init_error; 6632 6623 } 6633 6624 6625 + stmmac_reset_queues_param(priv); 6626 + 6634 6627 /* DMA CSR Channel configuration */ 6635 6628 for (chan = 0; chan < dma_csr_ch; chan++) { 6636 6629 stmmac_init_chan(priv, priv->ioaddr, priv->plat->dma_cfg, chan); ··· 6959 6948 int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt) 6960 6949 { 6961 6950 struct stmmac_priv *priv = netdev_priv(dev); 6962 - int ret = 0; 6951 + int ret = 0, i; 6963 6952 6964 6953 if (netif_running(dev)) 6965 6954 stmmac_release(dev); ··· 6968 6957 6969 6958 priv->plat->rx_queues_to_use = rx_cnt; 6970 6959 priv->plat->tx_queues_to_use = tx_cnt; 6960 + if (!netif_is_rxfh_configured(dev)) 6961 + for (i = 0; i < ARRAY_SIZE(priv->rss.table); i++) 6962 + priv->rss.table[i] = ethtool_rxfh_indir_default(i, 6963 + rx_cnt); 6971 6964 6972 6965 stmmac_napi_add(dev); 6973 6966
+4 -2
drivers/net/ethernet/ti/am65-cpsw-nuss.c
··· 2926 2926 am65_cpsw_nuss_phylink_cleanup(common); 2927 2927 am65_cpts_release(common->cpts); 2928 2928 err_of_clear: 2929 - of_platform_device_destroy(common->mdio_dev, NULL); 2929 + if (common->mdio_dev) 2930 + of_platform_device_destroy(common->mdio_dev, NULL); 2930 2931 err_pm_clear: 2931 2932 pm_runtime_put_sync(dev); 2932 2933 pm_runtime_disable(dev); ··· 2957 2956 am65_cpts_release(common->cpts); 2958 2957 am65_cpsw_disable_serdes_phy(common); 2959 2958 2960 - of_platform_device_destroy(common->mdio_dev, NULL); 2959 + if (common->mdio_dev) 2960 + of_platform_device_destroy(common->mdio_dev, NULL); 2961 2961 2962 2962 pm_runtime_put_sync(&pdev->dev); 2963 2963 pm_runtime_disable(&pdev->dev);
+19
drivers/net/phy/phylink.c
··· 1586 1586 } 1587 1587 EXPORT_SYMBOL_GPL(phylink_destroy); 1588 1588 1589 + /** 1590 + * phylink_expects_phy() - Determine if phylink expects a phy to be attached 1591 + * @pl: a pointer to a &struct phylink returned from phylink_create() 1592 + * 1593 + * When using fixed-link mode, or in-band mode with 1000base-X or 2500base-X, 1594 + * no PHY is needed. 1595 + * 1596 + * Returns true if phylink will be expecting a PHY. 1597 + */ 1598 + bool phylink_expects_phy(struct phylink *pl) 1599 + { 1600 + if (pl->cfg_link_an_mode == MLO_AN_FIXED || 1601 + (pl->cfg_link_an_mode == MLO_AN_INBAND && 1602 + phy_interface_mode_is_8023z(pl->link_config.interface))) 1603 + return false; 1604 + return true; 1605 + } 1606 + EXPORT_SYMBOL_GPL(phylink_expects_phy); 1607 + 1589 1608 static void phylink_phy_change(struct phy_device *phydev, bool up) 1590 1609 { 1591 1610 struct phylink *pl = phydev->phylink;
+4
drivers/net/phy/sfp.c
··· 387 387 388 388 SFP_QUIRK_F("HALNy", "HL-GSFP", sfp_fixup_halny_gsfp), 389 389 390 + // HG MXPD-483II-F 2.5G supports 2500Base-X, but incorrectly reports 391 + // 2600MBd in their EERPOM 392 + SFP_QUIRK_M("HG GENUINE", "MXPD-483II", sfp_quirk_2500basex), 393 + 390 394 // Huawei MA5671A can operate at 2500base-X, but report 1.2GBd NRZ in 391 395 // their EEPROM 392 396 SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex,
+1 -1
drivers/net/wireless/ath/ath11k/mhi.c
··· 16 16 #include "pci.h" 17 17 #include "pcic.h" 18 18 19 - #define MHI_TIMEOUT_DEFAULT_MS 90000 19 + #define MHI_TIMEOUT_DEFAULT_MS 20000 20 20 #define RDDM_DUMP_SIZE 0x420000 21 21 22 22 static struct mhi_channel_config ath11k_mhi_channels_qca6390[] = {
+26 -10
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
··· 994 994 MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids); 995 995 996 996 997 - static void brcmf_sdiod_acpi_set_power_manageable(struct device *dev, 998 - int val) 997 + static void brcmf_sdiod_acpi_save_power_manageable(struct brcmf_sdio_dev *sdiodev) 999 998 { 1000 999 #if IS_ENABLED(CONFIG_ACPI) 1001 1000 struct acpi_device *adev; 1002 1001 1003 - adev = ACPI_COMPANION(dev); 1002 + adev = ACPI_COMPANION(&sdiodev->func1->dev); 1004 1003 if (adev) 1005 - adev->flags.power_manageable = 0; 1004 + sdiodev->func1_power_manageable = adev->flags.power_manageable; 1005 + 1006 + adev = ACPI_COMPANION(&sdiodev->func2->dev); 1007 + if (adev) 1008 + sdiodev->func2_power_manageable = adev->flags.power_manageable; 1009 + #endif 1010 + } 1011 + 1012 + static void brcmf_sdiod_acpi_set_power_manageable(struct brcmf_sdio_dev *sdiodev, 1013 + int enable) 1014 + { 1015 + #if IS_ENABLED(CONFIG_ACPI) 1016 + struct acpi_device *adev; 1017 + 1018 + adev = ACPI_COMPANION(&sdiodev->func1->dev); 1019 + if (adev) 1020 + adev->flags.power_manageable = enable ? sdiodev->func1_power_manageable : 0; 1021 + 1022 + adev = ACPI_COMPANION(&sdiodev->func2->dev); 1023 + if (adev) 1024 + adev->flags.power_manageable = enable ? sdiodev->func2_power_manageable : 0; 1006 1025 #endif 1007 1026 } 1008 1027 ··· 1031 1012 int err; 1032 1013 struct brcmf_sdio_dev *sdiodev; 1033 1014 struct brcmf_bus *bus_if; 1034 - struct device *dev; 1035 1015 1036 1016 brcmf_dbg(SDIO, "Enter\n"); 1037 1017 brcmf_dbg(SDIO, "Class=%x\n", func->class); ··· 1038 1020 brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); 1039 1021 brcmf_dbg(SDIO, "Function#: %d\n", func->num); 1040 1022 1041 - dev = &func->dev; 1042 - 1043 1023 /* Set MMC_QUIRK_LENIENT_FN0 for this card */ 1044 1024 func->card->quirks |= MMC_QUIRK_LENIENT_FN0; 1045 - 1046 - /* prohibit ACPI power management for this device */ 1047 - brcmf_sdiod_acpi_set_power_manageable(dev, 0); 1048 1025 1049 1026 /* Consume func num 1 but dont do anything with it. */ 1050 1027 if (func->num == 1) ··· 1072 1059 dev_set_drvdata(&sdiodev->func1->dev, bus_if); 1073 1060 sdiodev->dev = &sdiodev->func1->dev; 1074 1061 1062 + brcmf_sdiod_acpi_save_power_manageable(sdiodev); 1075 1063 brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_DOWN); 1076 1064 1077 1065 brcmf_dbg(SDIO, "F2 found, calling brcmf_sdiod_probe...\n"); ··· 1138 1124 1139 1125 if (sdiodev->settings->bus.sdio.oob_irq_supported || 1140 1126 pm_caps & MMC_PM_WAKE_SDIO_IRQ) { 1127 + /* Stop ACPI from turning off the device when wowl is enabled */ 1128 + brcmf_sdiod_acpi_set_power_manageable(sdiodev, !enabled); 1141 1129 sdiodev->wowl_enabled = enabled; 1142 1130 brcmf_dbg(SDIO, "Configuring WOWL, enabled=%d\n", enabled); 1143 1131 return;
+2
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
··· 188 188 char nvram_name[BRCMF_FW_NAME_LEN]; 189 189 char clm_name[BRCMF_FW_NAME_LEN]; 190 190 bool wowl_enabled; 191 + bool func1_power_manageable; 192 + bool func2_power_manageable; 191 193 enum brcmf_sdiod_state state; 192 194 struct brcmf_sdiod_freezer *freezer; 193 195 const struct firmware *clm_fw;
+5 -5
drivers/net/wireless/mediatek/mt76/mt7603/main.c
··· 512 512 !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) 513 513 return -EOPNOTSUPP; 514 514 515 - if (cmd == SET_KEY) { 516 - key->hw_key_idx = wcid->idx; 517 - wcid->hw_key_idx = idx; 518 - } else { 515 + if (cmd != SET_KEY) { 519 516 if (idx == wcid->hw_key_idx) 520 517 wcid->hw_key_idx = -1; 521 518 522 - key = NULL; 519 + return 0; 523 520 } 521 + 522 + key->hw_key_idx = wcid->idx; 523 + wcid->hw_key_idx = idx; 524 524 mt76_wcid_key_setup(&dev->mt76, wcid, key); 525 525 526 526 return mt7603_wtbl_set_key(dev, wcid->idx, key);
+21 -49
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
··· 1193 1193 static int 1194 1194 mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, 1195 1195 struct ieee80211_key_conf *key, 1196 - enum mt76_cipher_type cipher, u16 cipher_mask, 1197 - enum set_key_cmd cmd) 1196 + enum mt76_cipher_type cipher, u16 cipher_mask) 1198 1197 { 1199 1198 u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx) + 30 * 4; 1200 1199 u8 data[32] = {}; ··· 1202 1203 return -EINVAL; 1203 1204 1204 1205 mt76_rr_copy(dev, addr, data, sizeof(data)); 1205 - if (cmd == SET_KEY) { 1206 - if (cipher == MT_CIPHER_TKIP) { 1207 - /* Rx/Tx MIC keys are swapped */ 1208 - memcpy(data, key->key, 16); 1209 - memcpy(data + 16, key->key + 24, 8); 1210 - memcpy(data + 24, key->key + 16, 8); 1211 - } else { 1212 - if (cipher_mask == BIT(cipher)) 1213 - memcpy(data, key->key, key->keylen); 1214 - else if (cipher != MT_CIPHER_BIP_CMAC_128) 1215 - memcpy(data, key->key, 16); 1216 - if (cipher == MT_CIPHER_BIP_CMAC_128) 1217 - memcpy(data + 16, key->key, 16); 1218 - } 1206 + if (cipher == MT_CIPHER_TKIP) { 1207 + /* Rx/Tx MIC keys are swapped */ 1208 + memcpy(data, key->key, 16); 1209 + memcpy(data + 16, key->key + 24, 8); 1210 + memcpy(data + 24, key->key + 16, 8); 1219 1211 } else { 1212 + if (cipher_mask == BIT(cipher)) 1213 + memcpy(data, key->key, key->keylen); 1214 + else if (cipher != MT_CIPHER_BIP_CMAC_128) 1215 + memcpy(data, key->key, 16); 1220 1216 if (cipher == MT_CIPHER_BIP_CMAC_128) 1221 - memset(data + 16, 0, 16); 1222 - else if (cipher_mask) 1223 - memset(data, 0, 16); 1224 - if (!cipher_mask) 1225 - memset(data, 0, sizeof(data)); 1217 + memcpy(data + 16, key->key, 16); 1226 1218 } 1227 1219 1228 1220 mt76_wr_copy(dev, addr, data, sizeof(data)); ··· 1224 1234 static int 1225 1235 mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid, 1226 1236 enum mt76_cipher_type cipher, u16 cipher_mask, 1227 - int keyidx, enum set_key_cmd cmd) 1237 + int keyidx) 1228 1238 { 1229 1239 u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx), w0, w1; 1230 1240 ··· 1243 1253 else 1244 1254 w0 &= ~MT_WTBL_W0_RX_IK_VALID; 1245 1255 1246 - if (cmd == SET_KEY && 1247 - (cipher != MT_CIPHER_BIP_CMAC_128 || 1248 - cipher_mask == BIT(cipher))) { 1256 + if (cipher != MT_CIPHER_BIP_CMAC_128 || cipher_mask == BIT(cipher)) { 1249 1257 w0 &= ~MT_WTBL_W0_KEY_IDX; 1250 1258 w0 |= FIELD_PREP(MT_WTBL_W0_KEY_IDX, keyidx); 1251 1259 } ··· 1260 1272 1261 1273 static void 1262 1274 mt7615_mac_wtbl_update_cipher(struct mt7615_dev *dev, struct mt76_wcid *wcid, 1263 - enum mt76_cipher_type cipher, u16 cipher_mask, 1264 - enum set_key_cmd cmd) 1275 + enum mt76_cipher_type cipher, u16 cipher_mask) 1265 1276 { 1266 1277 u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx); 1267 - 1268 - if (!cipher_mask) { 1269 - mt76_clear(dev, addr + 2 * 4, MT_WTBL_W2_KEY_TYPE); 1270 - return; 1271 - } 1272 - 1273 - if (cmd != SET_KEY) 1274 - return; 1275 1278 1276 1279 if (cipher == MT_CIPHER_BIP_CMAC_128 && 1277 1280 cipher_mask & ~BIT(MT_CIPHER_BIP_CMAC_128)) ··· 1274 1295 1275 1296 int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, 1276 1297 struct mt76_wcid *wcid, 1277 - struct ieee80211_key_conf *key, 1278 - enum set_key_cmd cmd) 1298 + struct ieee80211_key_conf *key) 1279 1299 { 1280 1300 enum mt76_cipher_type cipher; 1281 1301 u16 cipher_mask = wcid->cipher; ··· 1284 1306 if (cipher == MT_CIPHER_NONE) 1285 1307 return -EOPNOTSUPP; 1286 1308 1287 - if (cmd == SET_KEY) 1288 - cipher_mask |= BIT(cipher); 1289 - else 1290 - cipher_mask &= ~BIT(cipher); 1291 - 1292 - mt7615_mac_wtbl_update_cipher(dev, wcid, cipher, cipher_mask, cmd); 1293 - err = mt7615_mac_wtbl_update_key(dev, wcid, key, cipher, cipher_mask, 1294 - cmd); 1309 + cipher_mask |= BIT(cipher); 1310 + mt7615_mac_wtbl_update_cipher(dev, wcid, cipher, cipher_mask); 1311 + err = mt7615_mac_wtbl_update_key(dev, wcid, key, cipher, cipher_mask); 1295 1312 if (err < 0) 1296 1313 return err; 1297 1314 1298 1315 err = mt7615_mac_wtbl_update_pk(dev, wcid, cipher, cipher_mask, 1299 - key->keyidx, cmd); 1316 + key->keyidx); 1300 1317 if (err < 0) 1301 1318 return err; 1302 1319 ··· 1302 1329 1303 1330 int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, 1304 1331 struct mt76_wcid *wcid, 1305 - struct ieee80211_key_conf *key, 1306 - enum set_key_cmd cmd) 1332 + struct ieee80211_key_conf *key) 1307 1333 { 1308 1334 int err; 1309 1335 1310 1336 spin_lock_bh(&dev->mt76.lock); 1311 - err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); 1337 + err = __mt7615_mac_wtbl_set_key(dev, wcid, key); 1312 1338 spin_unlock_bh(&dev->mt76.lock); 1313 1339 1314 1340 return err;
+7 -8
drivers/net/wireless/mediatek/mt76/mt7615/main.c
··· 391 391 392 392 if (cmd == SET_KEY) 393 393 *wcid_keyidx = idx; 394 - else if (idx == *wcid_keyidx) 395 - *wcid_keyidx = -1; 396 - else 394 + else { 395 + if (idx == *wcid_keyidx) 396 + *wcid_keyidx = -1; 397 397 goto out; 398 + } 398 399 399 - mt76_wcid_key_setup(&dev->mt76, wcid, 400 - cmd == SET_KEY ? key : NULL); 401 - 400 + mt76_wcid_key_setup(&dev->mt76, wcid, key); 402 401 if (mt76_is_mmio(&dev->mt76)) 403 - err = mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); 402 + err = mt7615_mac_wtbl_set_key(dev, wcid, key); 404 403 else 405 - err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); 404 + err = __mt7615_mac_wtbl_set_key(dev, wcid, key); 406 405 407 406 out: 408 407 mt7615_mutex_release(dev);
+2 -4
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
··· 490 490 void mt7615_mac_set_timing(struct mt7615_phy *phy); 491 491 int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, 492 492 struct mt76_wcid *wcid, 493 - struct ieee80211_key_conf *key, 494 - enum set_key_cmd cmd); 493 + struct ieee80211_key_conf *key); 495 494 int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, 496 - struct ieee80211_key_conf *key, 497 - enum set_key_cmd cmd); 495 + struct ieee80211_key_conf *key); 498 496 void mt7615_mac_reset_work(struct work_struct *work); 499 497 u32 mt7615_mac_get_sta_tid_sn(struct mt7615_dev *dev, int wcid, u8 tid); 500 498
+9 -9
drivers/net/wireless/mediatek/mt76/mt76x02_util.c
··· 454 454 msta = sta ? (struct mt76x02_sta *)sta->drv_priv : NULL; 455 455 wcid = msta ? &msta->wcid : &mvif->group_wcid; 456 456 457 - if (cmd == SET_KEY) { 458 - key->hw_key_idx = wcid->idx; 459 - wcid->hw_key_idx = idx; 460 - if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) { 461 - key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; 462 - wcid->sw_iv = true; 463 - } 464 - } else { 457 + if (cmd != SET_KEY) { 465 458 if (idx == wcid->hw_key_idx) { 466 459 wcid->hw_key_idx = -1; 467 460 wcid->sw_iv = false; 468 461 } 469 462 470 - key = NULL; 463 + return 0; 464 + } 465 + 466 + key->hw_key_idx = wcid->idx; 467 + wcid->hw_key_idx = idx; 468 + if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) { 469 + key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; 470 + wcid->sw_iv = true; 471 471 } 472 472 mt76_wcid_key_setup(&dev->mt76, wcid, key); 473 473
+6 -7
drivers/net/wireless/mediatek/mt76/mt7915/main.c
··· 410 410 mt7915_mcu_add_bss_info(phy, vif, true); 411 411 } 412 412 413 - if (cmd == SET_KEY) 413 + if (cmd == SET_KEY) { 414 414 *wcid_keyidx = idx; 415 - else if (idx == *wcid_keyidx) 416 - *wcid_keyidx = -1; 417 - else 415 + } else { 416 + if (idx == *wcid_keyidx) 417 + *wcid_keyidx = -1; 418 418 goto out; 419 + } 419 420 420 - mt76_wcid_key_setup(&dev->mt76, wcid, 421 - cmd == SET_KEY ? key : NULL); 422 - 421 + mt76_wcid_key_setup(&dev->mt76, wcid, key); 423 422 err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip, 424 423 key, MCU_EXT_CMD(STA_REC_UPDATE), 425 424 &msta->wcid, cmd);
+5 -2
drivers/net/wireless/mediatek/mt76/mt7921/init.c
··· 171 171 172 172 u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm) 173 173 { 174 - struct mt7921_fw_features *features = NULL; 175 174 const struct mt76_connac2_fw_trailer *hdr; 176 175 struct mt7921_realease_info *rel_info; 177 176 const struct firmware *fw; 178 177 int ret, i, offset = 0; 179 178 const u8 *data, *end; 179 + u8 offload_caps = 0; 180 180 181 181 ret = request_firmware(&fw, fw_wm, dev); 182 182 if (ret) ··· 208 208 data += sizeof(*rel_info); 209 209 210 210 if (rel_info->tag == MT7921_FW_TAG_FEATURE) { 211 + struct mt7921_fw_features *features; 212 + 211 213 features = (struct mt7921_fw_features *)data; 214 + offload_caps = features->data; 212 215 break; 213 216 } 214 217 ··· 221 218 out: 222 219 release_firmware(fw); 223 220 224 - return features ? features->data : 0; 221 + return offload_caps; 225 222 } 226 223 EXPORT_SYMBOL_GPL(mt7921_check_offload_capability); 227 224
+6 -7
drivers/net/wireless/mediatek/mt76/mt7921/main.c
··· 569 569 570 570 mt7921_mutex_acquire(dev); 571 571 572 - if (cmd == SET_KEY) 572 + if (cmd == SET_KEY) { 573 573 *wcid_keyidx = idx; 574 - else if (idx == *wcid_keyidx) 575 - *wcid_keyidx = -1; 576 - else 574 + } else { 575 + if (idx == *wcid_keyidx) 576 + *wcid_keyidx = -1; 577 577 goto out; 578 + } 578 579 579 - mt76_wcid_key_setup(&dev->mt76, wcid, 580 - cmd == SET_KEY ? key : NULL); 581 - 580 + mt76_wcid_key_setup(&dev->mt76, wcid, key); 582 581 err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip, 583 582 key, MCU_UNI_CMD(STA_REC_UPDATE), 584 583 &msta->wcid, cmd);
+1 -1
drivers/net/wireless/mediatek/mt76/mt7921/pci.c
··· 20 20 { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0608), 21 21 .driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM }, 22 22 { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0616), 23 - .driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM }, 23 + .driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM }, 24 24 { }, 25 25 }; 26 26
+6 -7
drivers/net/wireless/mediatek/mt76/mt7996/main.c
··· 351 351 mt7996_mcu_add_bss_info(phy, vif, true); 352 352 } 353 353 354 - if (cmd == SET_KEY) 354 + if (cmd == SET_KEY) { 355 355 *wcid_keyidx = idx; 356 - else if (idx == *wcid_keyidx) 357 - *wcid_keyidx = -1; 358 - else 356 + } else { 357 + if (idx == *wcid_keyidx) 358 + *wcid_keyidx = -1; 359 359 goto out; 360 + } 360 361 361 - mt76_wcid_key_setup(&dev->mt76, wcid, 362 - cmd == SET_KEY ? key : NULL); 363 - 362 + mt76_wcid_key_setup(&dev->mt76, wcid, key); 364 363 err = mt7996_mcu_add_key(&dev->mt76, vif, &msta->bip, 365 364 key, MCU_WMWA_UNI_CMD(STA_REC_UPDATE), 366 365 &msta->wcid, cmd);
-2
drivers/net/wwan/t7xx/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 3 - ccflags-y += -Werror 4 - 5 3 obj-${CONFIG_MTK_T7XX} := mtk_t7xx.o 6 4 mtk_t7xx-y:= t7xx_pci.o \ 7 5 t7xx_pcie_mac.o \
+1
include/linux/phylink.h
··· 574 574 phy_interface_t iface, 575 575 const struct phylink_mac_ops *mac_ops); 576 576 void phylink_destroy(struct phylink *); 577 + bool phylink_expects_phy(struct phylink *pl); 577 578 578 579 int phylink_connect_phy(struct phylink *, struct phy_device *); 579 580 int phylink_of_phy_connect(struct phylink *, struct device_node *, u32 flags);
+2 -2
include/net/raw.h
··· 37 37 struct raw_hashinfo { 38 38 spinlock_t lock; 39 39 40 - struct hlist_nulls_head ht[RAW_HTABLE_SIZE] ____cacheline_aligned; 40 + struct hlist_head ht[RAW_HTABLE_SIZE] ____cacheline_aligned; 41 41 }; 42 42 43 43 static inline u32 raw_hashfunc(const struct net *net, u32 proto) ··· 51 51 52 52 spin_lock_init(&hashinfo->lock); 53 53 for (i = 0; i < RAW_HTABLE_SIZE; i++) 54 - INIT_HLIST_NULLS_HEAD(&hashinfo->ht[i], i); 54 + INIT_HLIST_HEAD(&hashinfo->ht[i]); 55 55 } 56 56 57 57 #ifdef CONFIG_PROC_FS
+48 -26
net/can/isotp.c
··· 119 119 ISOTP_WAIT_FIRST_FC, 120 120 ISOTP_WAIT_FC, 121 121 ISOTP_WAIT_DATA, 122 - ISOTP_SENDING 122 + ISOTP_SENDING, 123 + ISOTP_SHUTDOWN, 123 124 }; 124 125 125 126 struct tpcon { ··· 881 880 txtimer); 882 881 struct sock *sk = &so->sk; 883 882 884 - /* don't handle timeouts in IDLE state */ 885 - if (so->tx.state == ISOTP_IDLE) 883 + /* don't handle timeouts in IDLE or SHUTDOWN state */ 884 + if (so->tx.state == ISOTP_IDLE || so->tx.state == ISOTP_SHUTDOWN) 886 885 return HRTIMER_NORESTART; 887 886 888 887 /* we did not get any flow control or echo frame in time */ ··· 919 918 { 920 919 struct sock *sk = sock->sk; 921 920 struct isotp_sock *so = isotp_sk(sk); 922 - u32 old_state = so->tx.state; 923 921 struct sk_buff *skb; 924 922 struct net_device *dev; 925 923 struct canfd_frame *cf; ··· 928 928 int off; 929 929 int err; 930 930 931 - if (!so->bound) 931 + if (!so->bound || so->tx.state == ISOTP_SHUTDOWN) 932 932 return -EADDRNOTAVAIL; 933 933 934 + wait_free_buffer: 934 935 /* we do not support multiple buffers - for now */ 935 - if (cmpxchg(&so->tx.state, ISOTP_IDLE, ISOTP_SENDING) != ISOTP_IDLE || 936 - wq_has_sleeper(&so->wait)) { 937 - if (msg->msg_flags & MSG_DONTWAIT) { 938 - err = -EAGAIN; 939 - goto err_out; 940 - } 936 + if (wq_has_sleeper(&so->wait) && (msg->msg_flags & MSG_DONTWAIT)) 937 + return -EAGAIN; 941 938 942 - /* wait for complete transmission of current pdu */ 943 - err = wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE); 944 - if (err) 945 - goto err_out; 939 + /* wait for complete transmission of current pdu */ 940 + err = wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE); 941 + if (err) 942 + goto err_event_drop; 946 943 947 - so->tx.state = ISOTP_SENDING; 944 + if (cmpxchg(&so->tx.state, ISOTP_IDLE, ISOTP_SENDING) != ISOTP_IDLE) { 945 + if (so->tx.state == ISOTP_SHUTDOWN) 946 + return -EADDRNOTAVAIL; 947 + 948 + goto wait_free_buffer; 948 949 } 949 950 950 951 if (!size || size > MAX_MSG_LENGTH) { ··· 1075 1074 1076 1075 if (wait_tx_done) { 1077 1076 /* wait for complete transmission of current pdu */ 1078 - wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE); 1077 + err = wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE); 1078 + if (err) 1079 + goto err_event_drop; 1079 1080 1080 1081 if (sk->sk_err) 1081 1082 return -sk->sk_err; ··· 1085 1082 1086 1083 return size; 1087 1084 1085 + err_event_drop: 1086 + /* got signal: force tx state machine to be idle */ 1087 + so->tx.state = ISOTP_IDLE; 1088 + hrtimer_cancel(&so->txfrtimer); 1089 + hrtimer_cancel(&so->txtimer); 1088 1090 err_out_drop: 1089 1091 /* drop this PDU and unlock a potential wait queue */ 1090 - old_state = ISOTP_IDLE; 1091 - err_out: 1092 - so->tx.state = old_state; 1093 - if (so->tx.state == ISOTP_IDLE) 1094 - wake_up_interruptible(&so->wait); 1092 + so->tx.state = ISOTP_IDLE; 1093 + wake_up_interruptible(&so->wait); 1095 1094 1096 1095 return err; 1097 1096 } ··· 1125 1120 if (ret < 0) 1126 1121 goto out_err; 1127 1122 1128 - sock_recv_timestamp(msg, sk, skb); 1123 + sock_recv_cmsgs(msg, sk, skb); 1129 1124 1130 1125 if (msg->msg_name) { 1131 1126 __sockaddr_check_size(ISOTP_MIN_NAMELEN); ··· 1155 1150 net = sock_net(sk); 1156 1151 1157 1152 /* wait for complete transmission of current pdu */ 1158 - wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE); 1153 + while (wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE) == 0 && 1154 + cmpxchg(&so->tx.state, ISOTP_IDLE, ISOTP_SHUTDOWN) != ISOTP_IDLE) 1155 + ; 1159 1156 1160 1157 /* force state machines to be idle also when a signal occurred */ 1161 - so->tx.state = ISOTP_IDLE; 1158 + so->tx.state = ISOTP_SHUTDOWN; 1162 1159 so->rx.state = ISOTP_IDLE; 1163 1160 1164 1161 spin_lock(&isotp_notifier_lock); ··· 1615 1608 return 0; 1616 1609 } 1617 1610 1611 + static __poll_t isotp_poll(struct file *file, struct socket *sock, poll_table *wait) 1612 + { 1613 + struct sock *sk = sock->sk; 1614 + struct isotp_sock *so = isotp_sk(sk); 1615 + 1616 + __poll_t mask = datagram_poll(file, sock, wait); 1617 + poll_wait(file, &so->wait, wait); 1618 + 1619 + /* Check for false positives due to TX state */ 1620 + if ((mask & EPOLLWRNORM) && (so->tx.state != ISOTP_IDLE)) 1621 + mask &= ~(EPOLLOUT | EPOLLWRNORM); 1622 + 1623 + return mask; 1624 + } 1625 + 1618 1626 static int isotp_sock_no_ioctlcmd(struct socket *sock, unsigned int cmd, 1619 1627 unsigned long arg) 1620 1628 { ··· 1645 1623 .socketpair = sock_no_socketpair, 1646 1624 .accept = sock_no_accept, 1647 1625 .getname = isotp_getname, 1648 - .poll = datagram_poll, 1626 + .poll = isotp_poll, 1649 1627 .ioctl = isotp_sock_no_ioctlcmd, 1650 1628 .gettstamp = sock_gettstamp, 1651 1629 .listen = sock_no_listen,
+4 -1
net/can/j1939/transport.c
··· 604 604 /* reserve CAN header */ 605 605 skb_reserve(skb, offsetof(struct can_frame, data)); 606 606 607 - memcpy(skb->cb, re_skcb, sizeof(skb->cb)); 607 + /* skb->cb must be large enough to hold a j1939_sk_buff_cb structure */ 608 + BUILD_BUG_ON(sizeof(skb->cb) < sizeof(*re_skcb)); 609 + 610 + memcpy(skb->cb, re_skcb, sizeof(*re_skcb)); 608 611 skcb = j1939_skb_to_cb(skb); 609 612 if (swap_src_dst) 610 613 j1939_skbcb_swap(skcb);
+18 -1
net/core/netpoll.c
··· 137 137 } 138 138 } 139 139 140 + static int netif_local_xmit_active(struct net_device *dev) 141 + { 142 + int i; 143 + 144 + for (i = 0; i < dev->num_tx_queues; i++) { 145 + struct netdev_queue *txq = netdev_get_tx_queue(dev, i); 146 + 147 + if (READ_ONCE(txq->xmit_lock_owner) == smp_processor_id()) 148 + return 1; 149 + } 150 + 151 + return 0; 152 + } 153 + 140 154 static void poll_one_napi(struct napi_struct *napi) 141 155 { 142 156 int work; ··· 197 183 if (!ni || down_trylock(&ni->dev_lock)) 198 184 return; 199 185 200 - if (!netif_running(dev)) { 186 + /* Some drivers will take the same locks in poll and xmit, 187 + * we can't poll if local CPU is already in xmit. 188 + */ 189 + if (!netif_running(dev) || netif_local_xmit_active(dev)) { 201 190 up(&ni->dev_lock); 202 191 return; 203 192 }
+4 -3
net/ethtool/linkmodes.c
··· 270 270 "lanes configuration not supported by device"); 271 271 return -EOPNOTSUPP; 272 272 } 273 - } else if (!lsettings->autoneg) { 274 - /* If autoneg is off and lanes parameter is not passed from user, 275 - * set the lanes parameter to 0. 273 + } else if (!lsettings->autoneg && ksettings->lanes) { 274 + /* If autoneg is off and lanes parameter is not passed from user but 275 + * it was defined previously then set the lanes parameter to 0. 276 276 */ 277 277 ksettings->lanes = 0; 278 + *mod = true; 278 279 } 279 280 280 281 ret = ethnl_update_bitset(ksettings->link_modes.advertising,
+5
net/ipv4/icmp.c
··· 749 749 room = 576; 750 750 room -= sizeof(struct iphdr) + icmp_param.replyopts.opt.opt.optlen; 751 751 room -= sizeof(struct icmphdr); 752 + /* Guard against tiny mtu. We need to include at least one 753 + * IP network header for this message to make any sense. 754 + */ 755 + if (room <= (int)sizeof(struct iphdr)) 756 + goto ende; 752 757 753 758 icmp_param.data_len = skb_in->len - icmp_param.offset; 754 759 if (icmp_param.data_len > room)
+4 -4
net/ipv4/ping.c
··· 1089 1089 } 1090 1090 1091 1091 void *ping_seq_start(struct seq_file *seq, loff_t *pos, sa_family_t family) 1092 - __acquires(RCU) 1092 + __acquires(ping_table.lock) 1093 1093 { 1094 1094 struct ping_iter_state *state = seq->private; 1095 1095 state->bucket = 0; 1096 1096 state->family = family; 1097 1097 1098 - rcu_read_lock(); 1098 + spin_lock(&ping_table.lock); 1099 1099 1100 1100 return *pos ? ping_get_idx(seq, *pos-1) : SEQ_START_TOKEN; 1101 1101 } ··· 1121 1121 EXPORT_SYMBOL_GPL(ping_seq_next); 1122 1122 1123 1123 void ping_seq_stop(struct seq_file *seq, void *v) 1124 - __releases(RCU) 1124 + __releases(ping_table.lock) 1125 1125 { 1126 - rcu_read_unlock(); 1126 + spin_unlock(&ping_table.lock); 1127 1127 } 1128 1128 EXPORT_SYMBOL_GPL(ping_seq_stop); 1129 1129
+19 -17
net/ipv4/raw.c
··· 91 91 int raw_hash_sk(struct sock *sk) 92 92 { 93 93 struct raw_hashinfo *h = sk->sk_prot->h.raw_hash; 94 - struct hlist_nulls_head *hlist; 94 + struct hlist_head *hlist; 95 95 96 96 hlist = &h->ht[raw_hashfunc(sock_net(sk), inet_sk(sk)->inet_num)]; 97 97 98 98 spin_lock(&h->lock); 99 - __sk_nulls_add_node_rcu(sk, hlist); 99 + sk_add_node_rcu(sk, hlist); 100 100 sock_set_flag(sk, SOCK_RCU_FREE); 101 101 spin_unlock(&h->lock); 102 102 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); ··· 110 110 struct raw_hashinfo *h = sk->sk_prot->h.raw_hash; 111 111 112 112 spin_lock(&h->lock); 113 - if (__sk_nulls_del_node_init_rcu(sk)) 113 + if (sk_del_node_init_rcu(sk)) 114 114 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 115 115 spin_unlock(&h->lock); 116 116 } ··· 163 163 static int raw_v4_input(struct net *net, struct sk_buff *skb, 164 164 const struct iphdr *iph, int hash) 165 165 { 166 - struct hlist_nulls_head *hlist; 167 - struct hlist_nulls_node *hnode; 168 166 int sdif = inet_sdif(skb); 167 + struct hlist_head *hlist; 169 168 int dif = inet_iif(skb); 170 169 int delivered = 0; 171 170 struct sock *sk; 172 171 173 172 hlist = &raw_v4_hashinfo.ht[hash]; 174 173 rcu_read_lock(); 175 - sk_nulls_for_each(sk, hnode, hlist) { 174 + sk_for_each_rcu(sk, hlist) { 176 175 if (!raw_v4_match(net, sk, iph->protocol, 177 176 iph->saddr, iph->daddr, dif, sdif)) 178 177 continue; ··· 263 264 void raw_icmp_error(struct sk_buff *skb, int protocol, u32 info) 264 265 { 265 266 struct net *net = dev_net(skb->dev); 266 - struct hlist_nulls_head *hlist; 267 - struct hlist_nulls_node *hnode; 268 267 int dif = skb->dev->ifindex; 269 268 int sdif = inet_sdif(skb); 269 + struct hlist_head *hlist; 270 270 const struct iphdr *iph; 271 271 struct sock *sk; 272 272 int hash; ··· 274 276 hlist = &raw_v4_hashinfo.ht[hash]; 275 277 276 278 rcu_read_lock(); 277 - sk_nulls_for_each(sk, hnode, hlist) { 279 + sk_for_each_rcu(sk, hlist) { 278 280 iph = (const struct iphdr *)skb->data; 279 281 if (!raw_v4_match(net, sk, iph->protocol, 280 282 iph->daddr, iph->saddr, dif, sdif)) ··· 948 950 { 949 951 struct raw_hashinfo *h = pde_data(file_inode(seq->file)); 950 952 struct raw_iter_state *state = raw_seq_private(seq); 951 - struct hlist_nulls_head *hlist; 952 - struct hlist_nulls_node *hnode; 953 + struct hlist_head *hlist; 953 954 struct sock *sk; 954 955 955 956 for (state->bucket = bucket; state->bucket < RAW_HTABLE_SIZE; 956 957 ++state->bucket) { 957 958 hlist = &h->ht[state->bucket]; 958 - sk_nulls_for_each(sk, hnode, hlist) { 959 + sk_for_each(sk, hlist) { 959 960 if (sock_net(sk) == seq_file_net(seq)) 960 961 return sk; 961 962 } ··· 967 970 struct raw_iter_state *state = raw_seq_private(seq); 968 971 969 972 do { 970 - sk = sk_nulls_next(sk); 973 + sk = sk_next(sk); 971 974 } while (sk && sock_net(sk) != seq_file_net(seq)); 972 975 973 976 if (!sk) ··· 986 989 } 987 990 988 991 void *raw_seq_start(struct seq_file *seq, loff_t *pos) 989 - __acquires(RCU) 992 + __acquires(&h->lock) 990 993 { 991 - rcu_read_lock(); 994 + struct raw_hashinfo *h = pde_data(file_inode(seq->file)); 995 + 996 + spin_lock(&h->lock); 997 + 992 998 return *pos ? raw_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; 993 999 } 994 1000 EXPORT_SYMBOL_GPL(raw_seq_start); ··· 1010 1010 EXPORT_SYMBOL_GPL(raw_seq_next); 1011 1011 1012 1012 void raw_seq_stop(struct seq_file *seq, void *v) 1013 - __releases(RCU) 1013 + __releases(&h->lock) 1014 1014 { 1015 - rcu_read_unlock(); 1015 + struct raw_hashinfo *h = pde_data(file_inode(seq->file)); 1016 + 1017 + spin_unlock(&h->lock); 1016 1018 } 1017 1019 EXPORT_SYMBOL_GPL(raw_seq_stop); 1018 1020
+4 -6
net/ipv4/raw_diag.c
··· 57 57 static struct sock *raw_sock_get(struct net *net, const struct inet_diag_req_v2 *r) 58 58 { 59 59 struct raw_hashinfo *hashinfo = raw_get_hashinfo(r); 60 - struct hlist_nulls_head *hlist; 61 - struct hlist_nulls_node *hnode; 60 + struct hlist_head *hlist; 62 61 struct sock *sk; 63 62 int slot; 64 63 ··· 67 68 rcu_read_lock(); 68 69 for (slot = 0; slot < RAW_HTABLE_SIZE; slot++) { 69 70 hlist = &hashinfo->ht[slot]; 70 - sk_nulls_for_each(sk, hnode, hlist) { 71 + sk_for_each_rcu(sk, hlist) { 71 72 if (raw_lookup(net, sk, r)) { 72 73 /* 73 74 * Grab it and keep until we fill ··· 141 142 struct raw_hashinfo *hashinfo = raw_get_hashinfo(r); 142 143 struct net *net = sock_net(skb->sk); 143 144 struct inet_diag_dump_data *cb_data; 144 - struct hlist_nulls_head *hlist; 145 - struct hlist_nulls_node *hnode; 146 145 int num, s_num, slot, s_slot; 146 + struct hlist_head *hlist; 147 147 struct sock *sk = NULL; 148 148 struct nlattr *bc; 149 149 ··· 159 161 num = 0; 160 162 161 163 hlist = &hashinfo->ht[slot]; 162 - sk_nulls_for_each(sk, hnode, hlist) { 164 + sk_for_each_rcu(sk, hlist) { 163 165 struct inet_sock *inet = inet_sk(sk); 164 166 165 167 if (!net_eq(sock_net(sk), net))
+6 -1
net/ipv6/ip6_output.c
··· 1965 1965 IP6_UPD_PO_STATS(net, rt->rt6i_idev, IPSTATS_MIB_OUT, skb->len); 1966 1966 if (proto == IPPROTO_ICMPV6) { 1967 1967 struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); 1968 + u8 icmp6_type; 1968 1969 1969 - ICMP6MSGOUT_INC_STATS(net, idev, icmp6_hdr(skb)->icmp6_type); 1970 + if (sk->sk_socket->type == SOCK_RAW && !inet_sk(sk)->hdrincl) 1971 + icmp6_type = fl6->fl6_icmp_type; 1972 + else 1973 + icmp6_type = icmp6_hdr(skb)->icmp6_type; 1974 + ICMP6MSGOUT_INC_STATS(net, idev, icmp6_type); 1970 1975 ICMP6_INC_STATS(net, idev, ICMP6_MIB_OUTMSGS); 1971 1976 } 1972 1977
+4 -6
net/ipv6/raw.c
··· 141 141 static bool ipv6_raw_deliver(struct sk_buff *skb, int nexthdr) 142 142 { 143 143 struct net *net = dev_net(skb->dev); 144 - struct hlist_nulls_head *hlist; 145 - struct hlist_nulls_node *hnode; 146 144 const struct in6_addr *saddr; 147 145 const struct in6_addr *daddr; 146 + struct hlist_head *hlist; 148 147 struct sock *sk; 149 148 bool delivered = false; 150 149 __u8 hash; ··· 154 155 hash = raw_hashfunc(net, nexthdr); 155 156 hlist = &raw_v6_hashinfo.ht[hash]; 156 157 rcu_read_lock(); 157 - sk_nulls_for_each(sk, hnode, hlist) { 158 + sk_for_each_rcu(sk, hlist) { 158 159 int filtered; 159 160 160 161 if (!raw_v6_match(net, sk, nexthdr, daddr, saddr, ··· 332 333 u8 type, u8 code, int inner_offset, __be32 info) 333 334 { 334 335 struct net *net = dev_net(skb->dev); 335 - struct hlist_nulls_head *hlist; 336 - struct hlist_nulls_node *hnode; 336 + struct hlist_head *hlist; 337 337 struct sock *sk; 338 338 int hash; 339 339 340 340 hash = raw_hashfunc(net, nexthdr); 341 341 hlist = &raw_v6_hashinfo.ht[hash]; 342 342 rcu_read_lock(); 343 - sk_nulls_for_each(sk, hnode, hlist) { 343 + sk_for_each_rcu(sk, hlist) { 344 344 /* Note: ipv6_hdr(skb) != skb->data */ 345 345 const struct ipv6hdr *ip6h = (const struct ipv6hdr *)skb->data; 346 346
+4 -4
net/l2tp/l2tp_ip.c
··· 677 677 MODULE_DESCRIPTION("L2TP over IP"); 678 678 MODULE_VERSION("1.0"); 679 679 680 - /* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like 681 - * enums 680 + /* Use the values of SOCK_DGRAM (2) as type and IPPROTO_L2TP (115) as protocol, 681 + * because __stringify doesn't like enums 682 682 */ 683 - MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP); 684 - MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_L2TP); 683 + MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 115, 2); 684 + MODULE_ALIAS_NET_PF_PROTO(PF_INET, 115);
+4 -4
net/l2tp/l2tp_ip6.c
··· 806 806 MODULE_DESCRIPTION("L2TP IP encapsulation for IPv6"); 807 807 MODULE_VERSION("1.0"); 808 808 809 - /* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like 810 - * enums 809 + /* Use the values of SOCK_DGRAM (2) as type and IPPROTO_L2TP (115) as protocol, 810 + * because __stringify doesn't like enums 811 811 */ 812 - MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP); 813 - MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP); 812 + MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 115, 2); 813 + MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115);
+16 -13
net/mac80211/rx.c
··· 2769 2769 if (sdata->crypto_tx_tailroom_needed_cnt) 2770 2770 tailroom = IEEE80211_ENCRYPT_TAILROOM; 2771 2771 2772 - if (!--mesh_hdr->ttl) { 2773 - if (multicast) 2774 - goto rx_accept; 2775 - 2776 - IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl); 2777 - return RX_DROP_MONITOR; 2778 - } 2779 - 2780 2772 if (mesh_hdr->flags & MESH_FLAGS_AE) { 2781 2773 struct mesh_path *mppath; 2782 2774 char *proxied_addr; ··· 2799 2807 if (ether_addr_equal(sdata->vif.addr, eth->h_dest)) 2800 2808 goto rx_accept; 2801 2809 2810 + if (!--mesh_hdr->ttl) { 2811 + if (multicast) 2812 + goto rx_accept; 2813 + 2814 + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl); 2815 + return RX_DROP_MONITOR; 2816 + } 2817 + 2802 2818 if (!ifmsh->mshcfg.dot11MeshForwarding) { 2803 2819 if (is_multicast_ether_addr(eth->h_dest)) 2804 2820 goto rx_accept; ··· 2833 2833 2834 2834 if (skb_cow_head(fwd_skb, hdrlen - sizeof(struct ethhdr))) 2835 2835 return RX_DROP_UNUSABLE; 2836 + 2837 + if (skb_linearize(fwd_skb)) 2838 + return RX_DROP_UNUSABLE; 2836 2839 } 2837 2840 2838 2841 fwd_hdr = skb_push(fwd_skb, hdrlen - sizeof(struct ethhdr)); ··· 2850 2847 hdrlen += ETH_ALEN; 2851 2848 else 2852 2849 fwd_skb->protocol = htons(fwd_skb->len - hdrlen); 2853 - skb_set_network_header(fwd_skb, hdrlen); 2850 + skb_set_network_header(fwd_skb, hdrlen + 2); 2854 2851 2855 2852 info = IEEE80211_SKB_CB(fwd_skb); 2856 2853 memset(info, 0, sizeof(*info)); ··· 2899 2896 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 2900 2897 __le16 fc = hdr->frame_control; 2901 2898 struct sk_buff_head frame_list; 2902 - static ieee80211_rx_result res; 2899 + ieee80211_rx_result res; 2903 2900 struct ethhdr ethhdr; 2904 2901 const u8 *check_da = ethhdr.h_dest, *check_sa = ethhdr.h_source; 2905 2902 ··· 2933 2930 data_offset, true)) 2934 2931 return RX_DROP_UNUSABLE; 2935 2932 2936 - if (rx->sta && rx->sta->amsdu_mesh_control < 0) { 2933 + if (rx->sta->amsdu_mesh_control < 0) { 2937 2934 bool valid_std = ieee80211_is_valid_amsdu(skb, true); 2938 2935 bool valid_nonstd = ieee80211_is_valid_amsdu(skb, false); 2939 2936 ··· 3009 3006 } 3010 3007 } 3011 3008 3012 - if (is_multicast_ether_addr(hdr->addr1)) 3009 + if (is_multicast_ether_addr(hdr->addr1) || !rx->sta) 3013 3010 return RX_DROP_UNUSABLE; 3014 3011 3015 3012 if (rx->key) { ··· 3040 3037 struct net_device *dev = sdata->dev; 3041 3038 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; 3042 3039 __le16 fc = hdr->frame_control; 3043 - static ieee80211_rx_result res; 3040 + ieee80211_rx_result res; 3044 3041 bool port_control; 3045 3042 int err; 3046 3043
+2 -1
net/mac80211/sta_info.c
··· 1264 1264 list_del_rcu(&sta->list); 1265 1265 sta->removed = true; 1266 1266 1267 - drv_sta_pre_rcu_remove(local, sta->sdata, sta); 1267 + if (sta->uploaded) 1268 + drv_sta_pre_rcu_remove(local, sta->sdata, sta); 1268 1269 1269 1270 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && 1270 1271 rcu_access_pointer(sdata->u.vlan.sta) == sta)
+1 -1
net/mac80211/util.c
··· 4906 4906 &eht_cap->eht_cap_elem, 4907 4907 is_ap); 4908 4908 return 2 + 1 + 4909 - sizeof(he_cap->he_cap_elem) + n + 4909 + sizeof(eht_cap->eht_cap_elem) + n + 4910 4910 ieee80211_eht_ppe_size(eht_cap->eht_ppe_thres[0], 4911 4911 eht_cap->eht_cap_elem.phy_cap_info); 4912 4912 return 0;
+9 -6
net/netlink/af_netlink.c
··· 1952 1952 struct scm_cookie scm; 1953 1953 struct sock *sk = sock->sk; 1954 1954 struct netlink_sock *nlk = nlk_sk(sk); 1955 - size_t copied; 1955 + size_t copied, max_recvmsg_len; 1956 1956 struct sk_buff *skb, *data_skb; 1957 1957 int err, ret; 1958 1958 ··· 1985 1985 #endif 1986 1986 1987 1987 /* Record the max length of recvmsg() calls for future allocations */ 1988 - nlk->max_recvmsg_len = max(nlk->max_recvmsg_len, len); 1989 - nlk->max_recvmsg_len = min_t(size_t, nlk->max_recvmsg_len, 1990 - SKB_WITH_OVERHEAD(32768)); 1988 + max_recvmsg_len = max(READ_ONCE(nlk->max_recvmsg_len), len); 1989 + max_recvmsg_len = min_t(size_t, max_recvmsg_len, 1990 + SKB_WITH_OVERHEAD(32768)); 1991 + WRITE_ONCE(nlk->max_recvmsg_len, max_recvmsg_len); 1991 1992 1992 1993 copied = data_skb->len; 1993 1994 if (len < copied) { ··· 2237 2236 struct netlink_ext_ack extack = {}; 2238 2237 struct netlink_callback *cb; 2239 2238 struct sk_buff *skb = NULL; 2239 + size_t max_recvmsg_len; 2240 2240 struct module *module; 2241 2241 int err = -ENOBUFS; 2242 2242 int alloc_min_size; ··· 2260 2258 cb = &nlk->cb; 2261 2259 alloc_min_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE); 2262 2260 2263 - if (alloc_min_size < nlk->max_recvmsg_len) { 2264 - alloc_size = nlk->max_recvmsg_len; 2261 + max_recvmsg_len = READ_ONCE(nlk->max_recvmsg_len); 2262 + if (alloc_min_size < max_recvmsg_len) { 2263 + alloc_size = max_recvmsg_len; 2265 2264 skb = alloc_skb(alloc_size, 2266 2265 (GFP_KERNEL & ~__GFP_DIRECT_RECLAIM) | 2267 2266 __GFP_NOWARN | __GFP_NORETRY);
+2
net/qrtr/af_qrtr.c
··· 393 393 struct qrtr_node *node; 394 394 unsigned long flags; 395 395 396 + mutex_lock(&qrtr_node_lock); 396 397 spin_lock_irqsave(&qrtr_nodes_lock, flags); 397 398 node = radix_tree_lookup(&qrtr_nodes, nid); 398 399 node = qrtr_node_acquire(node); 399 400 spin_unlock_irqrestore(&qrtr_nodes_lock, flags); 401 + mutex_unlock(&qrtr_node_lock); 400 402 401 403 return node; 402 404 }
+9 -6
net/qrtr/ns.c
··· 274 274 return NULL; 275 275 } 276 276 277 - static int server_del(struct qrtr_node *node, unsigned int port) 277 + static int server_del(struct qrtr_node *node, unsigned int port, bool bcast) 278 278 { 279 279 struct qrtr_lookup *lookup; 280 280 struct qrtr_server *srv; ··· 287 287 radix_tree_delete(&node->servers, port); 288 288 289 289 /* Broadcast the removal of local servers */ 290 - if (srv->node == qrtr_ns.local_node) 290 + if (srv->node == qrtr_ns.local_node && bcast) 291 291 service_announce_del(&qrtr_ns.bcast_sq, srv); 292 292 293 293 /* Announce the service's disappearance to observers */ ··· 373 373 } 374 374 slot = radix_tree_iter_resume(slot, &iter); 375 375 rcu_read_unlock(); 376 - server_del(node, srv->port); 376 + server_del(node, srv->port, true); 377 377 rcu_read_lock(); 378 378 } 379 379 rcu_read_unlock(); ··· 459 459 kfree(lookup); 460 460 } 461 461 462 - /* Remove the server belonging to this port */ 462 + /* Remove the server belonging to this port but don't broadcast 463 + * DEL_SERVER. Neighbours would've already removed the server belonging 464 + * to this port due to the DEL_CLIENT broadcast from qrtr_port_remove(). 465 + */ 463 466 node = node_get(node_id); 464 467 if (node) 465 - server_del(node, port); 468 + server_del(node, port, false); 466 469 467 470 /* Advertise the removal of this client to all local servers */ 468 471 local_node = node_get(qrtr_ns.local_node); ··· 570 567 if (!node) 571 568 return -ENOENT; 572 569 573 - return server_del(node, port); 570 + return server_del(node, port, true); 574 571 } 575 572 576 573 static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,
+4
net/sctp/socket.c
··· 1830 1830 err = sctp_wait_for_sndbuf(asoc, &timeo, msg_len); 1831 1831 if (err) 1832 1832 goto err; 1833 + if (unlikely(sinfo->sinfo_stream >= asoc->stream.outcnt)) { 1834 + err = -EINVAL; 1835 + goto err; 1836 + } 1833 1837 } 1834 1838 1835 1839 if (sctp_state(asoc, CLOSED)) {
+10
net/vmw_vsock/virtio_transport_common.c
··· 94 94 info->op, 95 95 info->flags); 96 96 97 + if (info->vsk && !skb_set_owner_sk_safe(skb, sk_vsock(info->vsk))) { 98 + WARN_ONCE(1, "failed to allocate skb on vsock socket with sk_refcnt == 0\n"); 99 + goto out; 100 + } 101 + 97 102 return skb; 98 103 99 104 out: ··· 1305 1300 if (virtio_transport_get_type(sk) != le16_to_cpu(hdr->type)) { 1306 1301 (void)virtio_transport_reset_no_sock(t, skb); 1307 1302 sock_put(sk); 1303 + goto free_pkt; 1304 + } 1305 + 1306 + if (!skb_set_owner_sk_safe(skb, sk)) { 1307 + WARN_ONCE(1, "receiving vsock socket has sk_refcnt == 0\n"); 1308 1308 goto free_pkt; 1309 1309 } 1310 1310
+7 -1
net/vmw_vsock/vmci_transport.c
··· 1842 1842 struct msghdr *msg, 1843 1843 size_t len) 1844 1844 { 1845 - return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); 1845 + ssize_t err; 1846 + 1847 + err = vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); 1848 + if (err < 0) 1849 + err = -ENOMEM; 1850 + 1851 + return err; 1846 1852 } 1847 1853 1848 1854 static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk)
+1
tools/testing/selftests/net/rps_default_mask.sh
··· 60 60 ip -n $NETNS link set dev $VETH up 61 61 chk_rps "changing rps_default_mask affect newly created devices" "" $VETH 3 62 62 chk_rps "changing rps_default_mask don't affect newly child netns[II]" $NETNS $VETH 0 63 + ip link del dev $VETH 63 64 ip netns del $NETNS 64 65 65 66 setup