Skip to content

Commit 453a4a5

Browse files
committed
Merge tag 'net-7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from Bluetooth, CAN, IPsec and Netfilter. Notably, this includes the fix for the Bluetooth regression that you were notified about. I'm not aware of any other pending regressions. Current release - regressions: - bluetooth: - fix stack-out-of-bounds read in l2cap_ecred_conn_req - fix regressions caused by reusing ident - netfilter: revisit array resize logic - eth: ice: set max queues in alloc_etherdev_mqs() Previous releases - regressions: - core: correctly handle tunneled traffic on IPV6_CSUM GSO fallback - bluetooth: - fix dangling pointer on mgmt_add_adv_patterns_monitor_complete - fix deadlock in l2cap_conn_del() - sched: codel: fix stale state for empty flows in fq_codel - ipv6: remove permanent routes from tb6_gc_hlist when all exceptions expire. - xfrm: fix skb_put() panic on non-linear skb during reassembly - openvswitch: - avoid releasing netdev before teardown completes - validate MPLS set/set_masked payload length - eth: iavf: fix out-of-bounds writes in iavf_get_ethtool_stats() Previous releases - always broken: - bluetooth: fix null-ptr-deref on l2cap_sock_ready_cb - udp: fix wildcard bind conflict check when using hash2 - netfilter: fix use of uninitialized rtp_addr in process_sdp - tls: Purge async_hold in tls_decrypt_async_wait() - xfrm: - prevent policy_hthresh.work from racing with netns teardown - fix skb leak with espintcp and async crypto - smc: fix double-free of smc_spd_priv when tee() duplicates splice pipe buffer - can: - add missing error handling to call can_ctrlmode_changelink() - fix OOB heap access in cgw_csum_crc8_rel() - eth: - mana: fix use-after-free in add_adev() error path - virtio-net: fix for VIRTIO_NET_F_GUEST_HDRLEN - bcmasp: fix double free of WoL irq" * tag 'net-7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (90 commits) net: macb: use the current queue number for stats netfilter: ctnetlink: use netlink policy range checks netfilter: nf_conntrack_sip: fix use of uninitialized rtp_addr in process_sdp netfilter: nf_conntrack_expect: skip expectations in other netns via proc netfilter: nf_conntrack_expect: store netns and zone in expectation netfilter: ctnetlink: ensure safe access to master conntrack netfilter: nf_conntrack_expect: use expect->helper netfilter: nf_conntrack_expect: honor expectation helper field netfilter: nft_set_rbtree: revisit array resize logic netfilter: ip6t_rt: reject oversized addrnr in rt_mt6_check() netfilter: nfnetlink_log: fix uninitialized padding leak in NFULA_PAYLOAD tls: Purge async_hold in tls_decrypt_async_wait() selftests: netfilter: nft_concat_range.sh: add check for flush+reload bug netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry Bluetooth: btusb: clamp SCO altsetting table indices Bluetooth: L2CAP: Fix ERTM re-init and zero pdu_len infinite loop Bluetooth: L2CAP: Fix deadlock in l2cap_conn_del() Bluetooth: btintel: serialize btintel_hw_error() with hci_req_sync_lock Bluetooth: L2CAP: Fix send LE flow credits in ACL link net: mana: fix use-after-free in add_adev() error path ...
2 parents 75c78a4 + db472c3 commit 453a4a5

86 files changed

Lines changed: 1057 additions & 387 deletions

Some content is hidden

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

drivers/bluetooth/btintel.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,30 +251,35 @@ void btintel_hw_error(struct hci_dev *hdev, u8 code)
251251

252252
bt_dev_err(hdev, "Hardware error 0x%2.2x", code);
253253

254+
hci_req_sync_lock(hdev);
255+
254256
skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
255257
if (IS_ERR(skb)) {
256258
bt_dev_err(hdev, "Reset after hardware error failed (%ld)",
257259
PTR_ERR(skb));
258-
return;
260+
goto unlock;
259261
}
260262
kfree_skb(skb);
261263

262264
skb = __hci_cmd_sync(hdev, 0xfc22, 1, &type, HCI_INIT_TIMEOUT);
263265
if (IS_ERR(skb)) {
264266
bt_dev_err(hdev, "Retrieving Intel exception info failed (%ld)",
265267
PTR_ERR(skb));
266-
return;
268+
goto unlock;
267269
}
268270

269271
if (skb->len != 13) {
270272
bt_dev_err(hdev, "Exception info size mismatch");
271273
kfree_skb(skb);
272-
return;
274+
goto unlock;
273275
}
274276

275277
bt_dev_err(hdev, "Exception info %s", (char *)(skb->data + 1));
276278

277279
kfree_skb(skb);
280+
281+
unlock:
282+
hci_req_sync_unlock(hdev);
278283
}
279284
EXPORT_SYMBOL_GPL(btintel_hw_error);
280285

drivers/bluetooth/btusb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2376,8 +2376,11 @@ static void btusb_work(struct work_struct *work)
23762376
if (data->air_mode == HCI_NOTIFY_ENABLE_SCO_CVSD) {
23772377
if (hdev->voice_setting & 0x0020) {
23782378
static const int alts[3] = { 2, 4, 5 };
2379+
unsigned int sco_idx;
23792380

2380-
new_alts = alts[data->sco_num - 1];
2381+
sco_idx = min_t(unsigned int, data->sco_num - 1,
2382+
ARRAY_SIZE(alts) - 1);
2383+
new_alts = alts[sco_idx];
23812384
} else {
23822385
new_alts = data->sco_num;
23832386
}

drivers/bluetooth/hci_ll.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ static int download_firmware(struct ll_device *lldev)
541541
if (err || !fw->data || !fw->size) {
542542
bt_dev_err(lldev->hu.hdev, "request_firmware failed(errno %d) for %s",
543543
err, bts_scr_name);
544+
if (!err)
545+
release_firmware(fw);
544546
return -EINVAL;
545547
}
546548
ptr = (void *)fw->data;

drivers/net/can/dev/netlink.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
601601
/* We need synchronization with dev->stop() */
602602
ASSERT_RTNL();
603603

604-
can_ctrlmode_changelink(dev, data, extack);
604+
err = can_ctrlmode_changelink(dev, data, extack);
605+
if (err)
606+
return err;
605607

606608
if (data[IFLA_CAN_BITTIMING]) {
607609
struct can_bittiming bt;

drivers/net/can/spi/mcp251x.c

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,11 @@ static int mcp251x_open(struct net_device *net)
12251225
}
12261226

12271227
mutex_lock(&priv->mcp_lock);
1228-
mcp251x_power_enable(priv->transceiver, 1);
1228+
ret = mcp251x_power_enable(priv->transceiver, 1);
1229+
if (ret) {
1230+
dev_err(&spi->dev, "failed to enable transceiver power: %pe\n", ERR_PTR(ret));
1231+
goto out_close_candev;
1232+
}
12291233

12301234
priv->force_quit = 0;
12311235
priv->tx_skb = NULL;
@@ -1272,6 +1276,7 @@ static int mcp251x_open(struct net_device *net)
12721276
mcp251x_hw_sleep(spi);
12731277
out_close:
12741278
mcp251x_power_enable(priv->transceiver, 0);
1279+
out_close_candev:
12751280
close_candev(net);
12761281
mutex_unlock(&priv->mcp_lock);
12771282
if (release_irq)
@@ -1516,11 +1521,25 @@ static int __maybe_unused mcp251x_can_resume(struct device *dev)
15161521
{
15171522
struct spi_device *spi = to_spi_device(dev);
15181523
struct mcp251x_priv *priv = spi_get_drvdata(spi);
1524+
int ret = 0;
15191525

1520-
if (priv->after_suspend & AFTER_SUSPEND_POWER)
1521-
mcp251x_power_enable(priv->power, 1);
1522-
if (priv->after_suspend & AFTER_SUSPEND_UP)
1523-
mcp251x_power_enable(priv->transceiver, 1);
1526+
if (priv->after_suspend & AFTER_SUSPEND_POWER) {
1527+
ret = mcp251x_power_enable(priv->power, 1);
1528+
if (ret) {
1529+
dev_err(dev, "failed to restore power: %pe\n", ERR_PTR(ret));
1530+
return ret;
1531+
}
1532+
}
1533+
1534+
if (priv->after_suspend & AFTER_SUSPEND_UP) {
1535+
ret = mcp251x_power_enable(priv->transceiver, 1);
1536+
if (ret) {
1537+
dev_err(dev, "failed to restore transceiver power: %pe\n", ERR_PTR(ret));
1538+
if (priv->after_suspend & AFTER_SUSPEND_POWER)
1539+
mcp251x_power_enable(priv->power, 0);
1540+
return ret;
1541+
}
1542+
}
15241543

15251544
if (priv->after_suspend & (AFTER_SUSPEND_POWER | AFTER_SUSPEND_UP))
15261545
queue_work(priv->wq, &priv->restart_work);

drivers/net/ethernet/airoha/airoha_ppe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ static int airoha_ppe_get_wdma_info(struct net_device *dev, const u8 *addr,
227227
if (!dev)
228228
return -ENODEV;
229229

230+
rcu_read_lock();
230231
err = dev_fill_forward_path(dev, addr, &stack);
232+
rcu_read_unlock();
231233
if (err)
232234
return err;
233235

drivers/net/ethernet/broadcom/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ config B44
2525
select SSB
2626
select MII
2727
select PHYLIB
28-
select FIXED_PHY if BCM47XX
28+
select FIXED_PHY
2929
help
3030
If you have a network (Ethernet) controller of this type, say Y
3131
or M here.

drivers/net/ethernet/broadcom/asp2/bcmasp.c

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,12 +1152,6 @@ void bcmasp_enable_wol(struct bcmasp_intf *intf, bool en)
11521152
}
11531153
}
11541154

1155-
static void bcmasp_wol_irq_destroy(struct bcmasp_priv *priv)
1156-
{
1157-
if (priv->wol_irq > 0)
1158-
free_irq(priv->wol_irq, priv);
1159-
}
1160-
11611155
static void bcmasp_eee_fixup(struct bcmasp_intf *intf, bool en)
11621156
{
11631157
u32 reg, phy_lpi_overwrite;
@@ -1255,7 +1249,7 @@ static int bcmasp_probe(struct platform_device *pdev)
12551249
if (priv->irq <= 0)
12561250
return -EINVAL;
12571251

1258-
priv->clk = devm_clk_get_optional_enabled(dev, "sw_asp");
1252+
priv->clk = devm_clk_get_optional(dev, "sw_asp");
12591253
if (IS_ERR(priv->clk))
12601254
return dev_err_probe(dev, PTR_ERR(priv->clk),
12611255
"failed to request clock\n");
@@ -1283,6 +1277,10 @@ static int bcmasp_probe(struct platform_device *pdev)
12831277

12841278
bcmasp_set_pdata(priv, pdata);
12851279

1280+
ret = clk_prepare_enable(priv->clk);
1281+
if (ret)
1282+
return dev_err_probe(dev, ret, "failed to start clock\n");
1283+
12861284
/* Enable all clocks to ensure successful probing */
12871285
bcmasp_core_clock_set(priv, ASP_CTRL_CLOCK_CTRL_ASP_ALL_DISABLE, 0);
12881286

@@ -1294,8 +1292,10 @@ static int bcmasp_probe(struct platform_device *pdev)
12941292

12951293
ret = devm_request_irq(&pdev->dev, priv->irq, bcmasp_isr, 0,
12961294
pdev->name, priv);
1297-
if (ret)
1298-
return dev_err_probe(dev, ret, "failed to request ASP interrupt: %d", ret);
1295+
if (ret) {
1296+
dev_err(dev, "Failed to request ASP interrupt: %d", ret);
1297+
goto err_clock_disable;
1298+
}
12991299

13001300
/* Register mdio child nodes */
13011301
of_platform_populate(dev->of_node, bcmasp_mdio_of_match, NULL, dev);
@@ -1307,13 +1307,17 @@ static int bcmasp_probe(struct platform_device *pdev)
13071307

13081308
priv->mda_filters = devm_kcalloc(dev, priv->num_mda_filters,
13091309
sizeof(*priv->mda_filters), GFP_KERNEL);
1310-
if (!priv->mda_filters)
1311-
return -ENOMEM;
1310+
if (!priv->mda_filters) {
1311+
ret = -ENOMEM;
1312+
goto err_clock_disable;
1313+
}
13121314

13131315
priv->net_filters = devm_kcalloc(dev, priv->num_net_filters,
13141316
sizeof(*priv->net_filters), GFP_KERNEL);
1315-
if (!priv->net_filters)
1316-
return -ENOMEM;
1317+
if (!priv->net_filters) {
1318+
ret = -ENOMEM;
1319+
goto err_clock_disable;
1320+
}
13171321

13181322
bcmasp_core_init_filters(priv);
13191323

@@ -1322,7 +1326,8 @@ static int bcmasp_probe(struct platform_device *pdev)
13221326
ports_node = of_find_node_by_name(dev->of_node, "ethernet-ports");
13231327
if (!ports_node) {
13241328
dev_warn(dev, "No ports found\n");
1325-
return -EINVAL;
1329+
ret = -EINVAL;
1330+
goto err_clock_disable;
13261331
}
13271332

13281333
i = 0;
@@ -1344,8 +1349,6 @@ static int bcmasp_probe(struct platform_device *pdev)
13441349
*/
13451350
bcmasp_core_clock_set(priv, 0, ASP_CTRL_CLOCK_CTRL_ASP_ALL_DISABLE);
13461351

1347-
clk_disable_unprepare(priv->clk);
1348-
13491352
/* Now do the registration of the network ports which will take care
13501353
* of managing the clock properly.
13511354
*/
@@ -1358,13 +1361,16 @@ static int bcmasp_probe(struct platform_device *pdev)
13581361
count++;
13591362
}
13601363

1364+
clk_disable_unprepare(priv->clk);
1365+
13611366
dev_info(dev, "Initialized %d port(s)\n", count);
13621367

13631368
return ret;
13641369

13651370
err_cleanup:
1366-
bcmasp_wol_irq_destroy(priv);
13671371
bcmasp_remove_intfs(priv);
1372+
err_clock_disable:
1373+
clk_disable_unprepare(priv->clk);
13681374

13691375
return ret;
13701376
}
@@ -1376,7 +1382,6 @@ static void bcmasp_remove(struct platform_device *pdev)
13761382
if (!priv)
13771383
return;
13781384

1379-
bcmasp_wol_irq_destroy(priv);
13801385
bcmasp_remove_intfs(priv);
13811386
}
13821387

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ static void macb_tx_unmap(struct macb *bp, struct macb_tx_skb *tx_skb, int budge
10711071
}
10721072

10731073
if (tx_skb->skb) {
1074-
napi_consume_skb(tx_skb->skb, budget);
1074+
dev_consume_skb_any(tx_skb->skb);
10751075
tx_skb->skb = NULL;
10761076
}
10771077
}
@@ -3224,7 +3224,7 @@ static void gem_get_ethtool_stats(struct net_device *dev,
32243224
spin_lock_irq(&bp->stats_lock);
32253225
gem_update_stats(bp);
32263226
memcpy(data, &bp->ethtool_stats, sizeof(u64)
3227-
* (GEM_STATS_LEN + QUEUE_STATS_LEN * MACB_MAX_QUEUES));
3227+
* (GEM_STATS_LEN + QUEUE_STATS_LEN * bp->num_queues));
32283228
spin_unlock_irq(&bp->stats_lock);
32293229
}
32303230

@@ -5776,9 +5776,9 @@ static int __maybe_unused macb_suspend(struct device *dev)
57765776
struct macb_queue *queue;
57775777
struct in_device *idev;
57785778
unsigned long flags;
5779+
u32 tmp, ifa_local;
57795780
unsigned int q;
57805781
int err;
5781-
u32 tmp;
57825782

57835783
if (!device_may_wakeup(&bp->dev->dev))
57845784
phy_exit(bp->phy);
@@ -5787,14 +5787,21 @@ static int __maybe_unused macb_suspend(struct device *dev)
57875787
return 0;
57885788

57895789
if (bp->wol & MACB_WOL_ENABLED) {
5790-
/* Check for IP address in WOL ARP mode */
5791-
idev = __in_dev_get_rcu(bp->dev);
5792-
if (idev)
5793-
ifa = rcu_dereference(idev->ifa_list);
5794-
if ((bp->wolopts & WAKE_ARP) && !ifa) {
5795-
netdev_err(netdev, "IP address not assigned as required by WoL walk ARP\n");
5796-
return -EOPNOTSUPP;
5790+
if (bp->wolopts & WAKE_ARP) {
5791+
/* Check for IP address in WOL ARP mode */
5792+
rcu_read_lock();
5793+
idev = __in_dev_get_rcu(bp->dev);
5794+
if (idev)
5795+
ifa = rcu_dereference(idev->ifa_list);
5796+
if (!ifa) {
5797+
rcu_read_unlock();
5798+
netdev_err(netdev, "IP address not assigned as required by WoL walk ARP\n");
5799+
return -EOPNOTSUPP;
5800+
}
5801+
ifa_local = be32_to_cpu(ifa->ifa_local);
5802+
rcu_read_unlock();
57975803
}
5804+
57985805
spin_lock_irqsave(&bp->lock, flags);
57995806

58005807
/* Disable Tx and Rx engines before disabling the queues,
@@ -5833,8 +5840,9 @@ static int __maybe_unused macb_suspend(struct device *dev)
58335840
if (bp->wolopts & WAKE_ARP) {
58345841
tmp |= MACB_BIT(ARP);
58355842
/* write IP address into register */
5836-
tmp |= MACB_BFEXT(IP, be32_to_cpu(ifa->ifa_local));
5843+
tmp |= MACB_BFEXT(IP, ifa_local);
58375844
}
5845+
spin_unlock_irqrestore(&bp->lock, flags);
58385846

58395847
/* Change interrupt handler and
58405848
* Enable WoL IRQ on queue 0
@@ -5847,25 +5855,26 @@ static int __maybe_unused macb_suspend(struct device *dev)
58475855
dev_err(dev,
58485856
"Unable to request IRQ %d (error %d)\n",
58495857
bp->queues[0].irq, err);
5850-
spin_unlock_irqrestore(&bp->lock, flags);
58515858
return err;
58525859
}
5860+
spin_lock_irqsave(&bp->lock, flags);
58535861
queue_writel(bp->queues, IER, GEM_BIT(WOL));
58545862
gem_writel(bp, WOL, tmp);
5863+
spin_unlock_irqrestore(&bp->lock, flags);
58555864
} else {
58565865
err = devm_request_irq(dev, bp->queues[0].irq, macb_wol_interrupt,
58575866
IRQF_SHARED, netdev->name, bp->queues);
58585867
if (err) {
58595868
dev_err(dev,
58605869
"Unable to request IRQ %d (error %d)\n",
58615870
bp->queues[0].irq, err);
5862-
spin_unlock_irqrestore(&bp->lock, flags);
58635871
return err;
58645872
}
5873+
spin_lock_irqsave(&bp->lock, flags);
58655874
queue_writel(bp->queues, IER, MACB_BIT(WOL));
58665875
macb_writel(bp, WOL, tmp);
5876+
spin_unlock_irqrestore(&bp->lock, flags);
58675877
}
5868-
spin_unlock_irqrestore(&bp->lock, flags);
58695878

58705879
enable_irq_wake(bp->queues[0].irq);
58715880
}
@@ -5932,6 +5941,8 @@ static int __maybe_unused macb_resume(struct device *dev)
59325941
queue_readl(bp->queues, ISR);
59335942
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
59345943
queue_writel(bp->queues, ISR, -1);
5944+
spin_unlock_irqrestore(&bp->lock, flags);
5945+
59355946
/* Replace interrupt handler on queue 0 */
59365947
devm_free_irq(dev, bp->queues[0].irq, bp->queues);
59375948
err = devm_request_irq(dev, bp->queues[0].irq, macb_interrupt,
@@ -5940,10 +5951,8 @@ static int __maybe_unused macb_resume(struct device *dev)
59405951
dev_err(dev,
59415952
"Unable to request IRQ %d (error %d)\n",
59425953
bp->queues[0].irq, err);
5943-
spin_unlock_irqrestore(&bp->lock, flags);
59445954
return err;
59455955
}
5946-
spin_unlock_irqrestore(&bp->lock, flags);
59475956

59485957
disable_irq_wake(bp->queues[0].irq);
59495958

drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,8 @@ static void enetc_get_ringparam(struct net_device *ndev,
813813
{
814814
struct enetc_ndev_priv *priv = netdev_priv(ndev);
815815

816+
ring->rx_max_pending = priv->rx_bd_count;
817+
ring->tx_max_pending = priv->tx_bd_count;
816818
ring->rx_pending = priv->rx_bd_count;
817819
ring->tx_pending = priv->tx_bd_count;
818820

0 commit comments

Comments
 (0)