Skip to content

Commit 9819a30

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Fix ieeeu02154 atusb driver use-after-free, from Johan Hovold. 2) Need to validate TCA_CBQ_WRROPT netlink attributes, from Eric Dumazet. 3) txq null deref in mac80211, from Miaoqing Pan. 4) ionic driver needs to select NET_DEVLINK, from Arnd Bergmann. 5) Need to disable bh during nft_connlimit GC, from Pablo Neira Ayuso. 6) Avoid division by zero in taprio scheduler, from Vladimir Oltean. 7) Various xgmac fixes in stmmac driver from Jose Abreu. 8) Avoid 64-bit division in mlx5 leading to link errors on 32-bit from Michal Kubecek. 9) Fix bad VLAN check in rtl8366 DSA driver, from Linus Walleij. 10) Fix sleep while atomic in sja1105, from Vladimir Oltean. 11) Suspend/resume deadlock in stmmac, from Thierry Reding. 12) Various UDP GSO fixes from Josh Hunt. 13) Fix slab out of bounds access in tcp_zerocopy_receive(), from Eric Dumazet. 14) Fix OOPS in __ipv6_ifa_notify(), from David Ahern. 15) Memory leak in NFC's llcp_sock_bind, from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (72 commits) selftests/net: add nettest to .gitignore net: qlogic: Fix memory leak in ql_alloc_large_buffers nfc: fix memory leak in llcp_sock_bind() sch_dsmark: fix potential NULL deref in dsmark_init() net: phy: at803x: use operating parameters from PHY-specific status net: phy: extract pause mode net: phy: extract link partner advertisement reading net: phy: fix write to mii-ctrl1000 register ipv6: Handle missing host route in __ipv6_ifa_notify net: phy: allow for reset line to be tied to a sleepy GPIO controller net: ipv4: avoid mixed n_redirects and rate_tokens usage r8152: Set macpassthru in reset_resume callback cxgb4:Fix out-of-bounds MSI-X info array access Revert "ipv6: Handle race in addrconf_dad_work" net: make sock_prot_memory_pressure() return "const char *" rxrpc: Fix rxrpc_recvmsg tracepoint qmi_wwan: add support for Cinterion CLS8 devices tcp: fix slab-out-of-bounds in tcp_zerocopy_receive() lib: textsearch: fix escapes in example code udp: only do GSO if # of segs > 1 ...
2 parents 6fe137c + ef129d3 commit 9819a30

Some content is hidden

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

99 files changed

+539
-281
lines changed

Documentation/networking/device_drivers/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Contents:
2323
intel/ice
2424
google/gve
2525
mellanox/mlx5
26+
netronome/nfp
2627
pensando/ionic
2728

2829
.. only:: subproject and html

Documentation/networking/j1939.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ supported flags are:
272272
* MSG_DONTWAIT, i.e. non-blocking operation.
273273

274274
recvmsg(2)
275-
^^^^^^^^^
275+
^^^^^^^^^^
276276

277277
In most cases recvmsg(2) is needed if you want to extract more information than
278278
recvfrom(2) can provide. For example package priority and timestamp. The

drivers/net/dsa/qca8k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ qca8k_setup(struct dsa_switch *ds)
705705
BIT(0) << QCA8K_GLOBAL_FW_CTRL1_UC_DP_S);
706706

707707
/* Setup connection between CPU port & user ports */
708-
for (i = 0; i < DSA_MAX_PORTS; i++) {
708+
for (i = 0; i < QCA8K_NUM_PORTS; i++) {
709709
/* CPU port gets connected to all user ports of the switch */
710710
if (dsa_is_cpu_port(ds, i)) {
711711
qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(QCA8K_CPU_PORT),
@@ -1077,7 +1077,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev)
10771077
if (id != QCA8K_ID_QCA8337)
10781078
return -ENODEV;
10791079

1080-
priv->ds = dsa_switch_alloc(&mdiodev->dev, DSA_MAX_PORTS);
1080+
priv->ds = dsa_switch_alloc(&mdiodev->dev, QCA8K_NUM_PORTS);
10811081
if (!priv->ds)
10821082
return -ENOMEM;
10831083

drivers/net/dsa/rtl8366.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,12 @@ int rtl8366_vlan_prepare(struct dsa_switch *ds, int port,
339339
const struct switchdev_obj_port_vlan *vlan)
340340
{
341341
struct realtek_smi *smi = ds->priv;
342+
u16 vid;
342343
int ret;
343344

344-
if (!smi->ops->is_vlan_valid(smi, port))
345-
return -EINVAL;
345+
for (vid = vlan->vid_begin; vid < vlan->vid_end; vid++)
346+
if (!smi->ops->is_vlan_valid(smi, vid))
347+
return -EINVAL;
346348

347349
dev_info(smi->dev, "prepare VLANs %04x..%04x\n",
348350
vlan->vid_begin, vlan->vid_end);
@@ -370,8 +372,9 @@ void rtl8366_vlan_add(struct dsa_switch *ds, int port,
370372
u16 vid;
371373
int ret;
372374

373-
if (!smi->ops->is_vlan_valid(smi, port))
374-
return;
375+
for (vid = vlan->vid_begin; vid < vlan->vid_end; vid++)
376+
if (!smi->ops->is_vlan_valid(smi, vid))
377+
return;
375378

376379
dev_info(smi->dev, "add VLAN on port %d, %s, %s\n",
377380
port,

drivers/net/dsa/rtl8366rb.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,15 +507,16 @@ static int rtl8366rb_setup_cascaded_irq(struct realtek_smi *smi)
507507
irq = of_irq_get(intc, 0);
508508
if (irq <= 0) {
509509
dev_err(smi->dev, "failed to get parent IRQ\n");
510-
return irq ? irq : -EINVAL;
510+
ret = irq ? irq : -EINVAL;
511+
goto out_put_node;
511512
}
512513

513514
/* This clears the IRQ status register */
514515
ret = regmap_read(smi->map, RTL8366RB_INTERRUPT_STATUS_REG,
515516
&val);
516517
if (ret) {
517518
dev_err(smi->dev, "can't read interrupt status\n");
518-
return ret;
519+
goto out_put_node;
519520
}
520521

521522
/* Fetch IRQ edge information from the descriptor */
@@ -537,28 +538,31 @@ static int rtl8366rb_setup_cascaded_irq(struct realtek_smi *smi)
537538
val);
538539
if (ret) {
539540
dev_err(smi->dev, "could not configure IRQ polarity\n");
540-
return ret;
541+
goto out_put_node;
541542
}
542543

543544
ret = devm_request_threaded_irq(smi->dev, irq, NULL,
544545
rtl8366rb_irq, IRQF_ONESHOT,
545546
"RTL8366RB", smi);
546547
if (ret) {
547548
dev_err(smi->dev, "unable to request irq: %d\n", ret);
548-
return ret;
549+
goto out_put_node;
549550
}
550551
smi->irqdomain = irq_domain_add_linear(intc,
551552
RTL8366RB_NUM_INTERRUPT,
552553
&rtl8366rb_irqdomain_ops,
553554
smi);
554555
if (!smi->irqdomain) {
555556
dev_err(smi->dev, "failed to create IRQ domain\n");
556-
return -EINVAL;
557+
ret = -EINVAL;
558+
goto out_put_node;
557559
}
558560
for (i = 0; i < smi->num_ports; i++)
559561
irq_set_parent(irq_create_mapping(smi->irqdomain, i), irq);
560562

561-
return 0;
563+
out_put_node:
564+
of_node_put(intc);
565+
return ret;
562566
}
563567

564568
static int rtl8366rb_set_addr(struct realtek_smi *smi)

drivers/net/dsa/sja1105/sja1105_main.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,9 @@ static int sja1105_set_ageing_time(struct dsa_switch *ds,
18971897
return sja1105_static_config_reload(priv);
18981898
}
18991899

1900-
/* Caller must hold priv->tagger_data.meta_lock */
1900+
/* Must be called only with priv->tagger_data.state bit
1901+
* SJA1105_HWTS_RX_EN cleared
1902+
*/
19011903
static int sja1105_change_rxtstamping(struct sja1105_private *priv,
19021904
bool on)
19031905
{
@@ -1954,16 +1956,17 @@ static int sja1105_hwtstamp_set(struct dsa_switch *ds, int port,
19541956
break;
19551957
}
19561958

1957-
if (rx_on != priv->tagger_data.hwts_rx_en) {
1958-
spin_lock(&priv->tagger_data.meta_lock);
1959+
if (rx_on != test_bit(SJA1105_HWTS_RX_EN, &priv->tagger_data.state)) {
1960+
clear_bit(SJA1105_HWTS_RX_EN, &priv->tagger_data.state);
1961+
19591962
rc = sja1105_change_rxtstamping(priv, rx_on);
1960-
spin_unlock(&priv->tagger_data.meta_lock);
19611963
if (rc < 0) {
19621964
dev_err(ds->dev,
19631965
"Failed to change RX timestamping: %d\n", rc);
1964-
return -EFAULT;
1966+
return rc;
19651967
}
1966-
priv->tagger_data.hwts_rx_en = rx_on;
1968+
if (rx_on)
1969+
set_bit(SJA1105_HWTS_RX_EN, &priv->tagger_data.state);
19671970
}
19681971

19691972
if (copy_to_user(ifr->ifr_data, &config, sizeof(config)))
@@ -1982,7 +1985,7 @@ static int sja1105_hwtstamp_get(struct dsa_switch *ds, int port,
19821985
config.tx_type = HWTSTAMP_TX_ON;
19831986
else
19841987
config.tx_type = HWTSTAMP_TX_OFF;
1985-
if (priv->tagger_data.hwts_rx_en)
1988+
if (test_bit(SJA1105_HWTS_RX_EN, &priv->tagger_data.state))
19861989
config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT;
19871990
else
19881991
config.rx_filter = HWTSTAMP_FILTER_NONE;
@@ -2005,12 +2008,12 @@ static void sja1105_rxtstamp_work(struct work_struct *work)
20052008

20062009
mutex_lock(&priv->ptp_lock);
20072010

2008-
now = priv->tstamp_cc.read(&priv->tstamp_cc);
2009-
20102011
while ((skb = skb_dequeue(&data->skb_rxtstamp_queue)) != NULL) {
20112012
struct skb_shared_hwtstamps *shwt = skb_hwtstamps(skb);
20122013
u64 ts;
20132014

2015+
now = priv->tstamp_cc.read(&priv->tstamp_cc);
2016+
20142017
*shwt = (struct skb_shared_hwtstamps) {0};
20152018

20162019
ts = SJA1105_SKB_CB(skb)->meta_tstamp;
@@ -2031,7 +2034,7 @@ static bool sja1105_port_rxtstamp(struct dsa_switch *ds, int port,
20312034
struct sja1105_private *priv = ds->priv;
20322035
struct sja1105_tagger_data *data = &priv->tagger_data;
20332036

2034-
if (!data->hwts_rx_en)
2037+
if (!test_bit(SJA1105_HWTS_RX_EN, &data->state))
20352038
return false;
20362039

20372040
/* We need to read the full PTP clock to reconstruct the Rx
@@ -2201,6 +2204,7 @@ static int sja1105_probe(struct spi_device *spi)
22012204
tagger_data = &priv->tagger_data;
22022205
skb_queue_head_init(&tagger_data->skb_rxtstamp_queue);
22032206
INIT_WORK(&tagger_data->rxtstamp_work, sja1105_rxtstamp_work);
2207+
spin_lock_init(&tagger_data->meta_lock);
22042208

22052209
/* Connections between dsa_port and sja1105_port */
22062210
for (i = 0; i < SJA1105_NUM_PORTS; i++) {

drivers/net/dsa/sja1105/sja1105_spi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ int sja1105_static_config_upload(struct sja1105_private *priv)
409409
rc = static_config_buf_prepare_for_upload(priv, config_buf, buf_len);
410410
if (rc < 0) {
411411
dev_err(dev, "Invalid config, cannot upload\n");
412-
return -EINVAL;
412+
rc = -EINVAL;
413+
goto out;
413414
}
414415
/* Prevent PHY jabbering during switch reset by inhibiting
415416
* Tx on all ports and waiting for current packet to drain.
@@ -418,7 +419,8 @@ int sja1105_static_config_upload(struct sja1105_private *priv)
418419
rc = sja1105_inhibit_tx(priv, port_bitmap, true);
419420
if (rc < 0) {
420421
dev_err(dev, "Failed to inhibit Tx on ports\n");
421-
return -ENXIO;
422+
rc = -ENXIO;
423+
goto out;
422424
}
423425
/* Wait for an eventual egress packet to finish transmission
424426
* (reach IFG). It is guaranteed that a second one will not

drivers/net/ethernet/atheros/ag71xx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ static int ag71xx_mdio_probe(struct ag71xx *ag)
526526
struct device *dev = &ag->pdev->dev;
527527
struct net_device *ndev = ag->ndev;
528528
static struct mii_bus *mii_bus;
529-
struct device_node *np;
529+
struct device_node *np, *mnp;
530530
int err;
531531

532532
np = dev->of_node;
@@ -571,7 +571,9 @@ static int ag71xx_mdio_probe(struct ag71xx *ag)
571571
msleep(200);
572572
}
573573

574-
err = of_mdiobus_register(mii_bus, np);
574+
mnp = of_get_child_by_name(np, "mdio");
575+
err = of_mdiobus_register(mii_bus, mnp);
576+
of_node_put(mnp);
575577
if (err)
576578
goto mdio_err_put_clk;
577579

drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,12 @@ static int uldrx_handler(struct sge_rspq *q, const __be64 *rsp,
137137
static int alloc_uld_rxqs(struct adapter *adap,
138138
struct sge_uld_rxq_info *rxq_info, bool lro)
139139
{
140-
struct sge *s = &adap->sge;
141140
unsigned int nq = rxq_info->nrxq + rxq_info->nciq;
141+
int i, err, msi_idx, que_idx = 0, bmap_idx = 0;
142142
struct sge_ofld_rxq *q = rxq_info->uldrxq;
143143
unsigned short *ids = rxq_info->rspq_id;
144-
unsigned int bmap_idx = 0;
144+
struct sge *s = &adap->sge;
145145
unsigned int per_chan;
146-
int i, err, msi_idx, que_idx = 0;
147146

148147
per_chan = rxq_info->nrxq / adap->params.nports;
149148

@@ -161,6 +160,10 @@ static int alloc_uld_rxqs(struct adapter *adap,
161160

162161
if (msi_idx >= 0) {
163162
bmap_idx = get_msix_idx_from_bmap(adap);
163+
if (bmap_idx < 0) {
164+
err = -ENOSPC;
165+
goto freeout;
166+
}
164167
msi_idx = adap->msix_info_ulds[bmap_idx].idx;
165168
}
166169
err = t4_sge_alloc_rxq(adap, &q->rspq, false,

drivers/net/ethernet/hisilicon/hns_mdio.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,15 @@ static int mdio_sc_cfg_reg_write(struct hns_mdio_device *mdio_dev,
148148
{
149149
u32 time_cnt;
150150
u32 reg_value;
151+
int ret;
151152

152153
regmap_write(mdio_dev->subctrl_vbase, cfg_reg, set_val);
153154

154155
for (time_cnt = MDIO_TIMEOUT; time_cnt; time_cnt--) {
155-
regmap_read(mdio_dev->subctrl_vbase, st_reg, &reg_value);
156+
ret = regmap_read(mdio_dev->subctrl_vbase, st_reg, &reg_value);
157+
if (ret)
158+
return ret;
159+
156160
reg_value &= st_msk;
157161
if ((!!check_st) == (!!reg_value))
158162
break;

0 commit comments

Comments
 (0)