Skip to content

Commit 010b676

Browse files
committed
Merge tag 'net-6.1-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth, can and netfilter. Current release - new code bugs: - bonding: ipv6: correct address used in Neighbour Advertisement parsing (src vs dst typo) - fec: properly scope IRQ coalesce setup during link up to supported chips only Previous releases - regressions: - Bluetooth fixes for fake CSR clones (knockoffs): - re-add ERR_DATA_REPORTING quirk - fix crash when device is replugged - Bluetooth: - silence a user-triggerable dmesg error message - L2CAP: fix u8 overflow, oob access - correct vendor codec definition - fix support for Read Local Supported Codecs V2 - ti: am65-cpsw: fix RGMII configuration at SPEED_10 - mana: fix race on per-CQ variable NAPI work_done Previous releases - always broken: - af_unix: diag: fetch user_ns from in_skb in unix_diag_get_exact(), avoid null-deref - af_can: fix NULL pointer dereference in can_rcv_filter - can: slcan: fix UAF with a freed work - can: can327: flush TX_work on ldisc .close() - macsec: add missing attribute validation for offload - ipv6: avoid use-after-free in ip6_fragment() - nft_set_pipapo: actually validate intervals in fields after the first one - mvneta: prevent oob access in mvneta_config_rss() - ipv4: fix incorrect route flushing when table ID 0 is used, or when source address is deleted - phy: mxl-gpy: add workaround for IRQ bug on GPY215B and GPY215C" * tag 'net-6.1-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (77 commits) net: dsa: sja1105: avoid out of bounds access in sja1105_init_l2_policing() s390/qeth: fix use-after-free in hsci macsec: add missing attribute validation for offload net: mvneta: Fix an out of bounds check net: thunderbolt: fix memory leak in tbnet_open() ipv6: avoid use-after-free in ip6_fragment() net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() net: phy: mxl-gpy: add MDINT workaround net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports xen/netback: don't call kfree_skb() under spin_lock_irqsave() dpaa2-switch: Fix memory leak in dpaa2_switch_acl_entry_add() and dpaa2_switch_acl_entry_remove() ethernet: aeroflex: fix potential skb leak in greth_init_rings() tipc: call tipc_lxc_xmit without holding node_read_lock can: esd_usb: Allow REC and TEC to return to zero can: can327: flush TX_work on ldisc .close() can: slcan: fix freed work crash can: af_can: fix NULL pointer dereference in can_rcv_filter net: dsa: sja1105: fix memory leak in sja1105_setup_devlink_regions() ipv4: Fix incorrect route flushing when table ID 0 is used ipv4: Fix incorrect route flushing when source address is deleted ...
2 parents ce19275 + f8bac7f commit 010b676

Some content is hidden

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

81 files changed

+643
-164
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ ForEachMacros:
535535
- 'perf_hpp_list__for_each_sort_list_safe'
536536
- 'perf_pmu__for_each_hybrid_pmu'
537537
- 'ping_portaddr_for_each_entry'
538+
- 'ping_portaddr_for_each_entry_rcu'
538539
- 'plist_for_each'
539540
- 'plist_for_each_continue'
540541
- 'plist_for_each_entry'

drivers/bluetooth/btusb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,11 @@ static int btusb_setup_csr(struct hci_dev *hdev)
20562056

20572057
rp = (struct hci_rp_read_local_version *)skb->data;
20582058

2059+
bt_dev_info(hdev, "CSR: Setting up dongle with HCI ver=%u rev=%04x; LMP ver=%u subver=%04x; manufacturer=%u",
2060+
le16_to_cpu(rp->hci_ver), le16_to_cpu(rp->hci_rev),
2061+
le16_to_cpu(rp->lmp_ver), le16_to_cpu(rp->lmp_subver),
2062+
le16_to_cpu(rp->manufacturer));
2063+
20592064
/* Detect a wide host of Chinese controllers that aren't CSR.
20602065
*
20612066
* Known fake bcdDevices: 0x0100, 0x0134, 0x1915, 0x2520, 0x7558, 0x8891
@@ -2118,6 +2123,7 @@ static int btusb_setup_csr(struct hci_dev *hdev)
21182123
* without these the controller will lock up.
21192124
*/
21202125
set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks);
2126+
set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks);
21212127
set_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks);
21222128
set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks);
21232129

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3247,7 +3247,7 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond,
32473247
goto out;
32483248

32493249
saddr = &combined->ip6.saddr;
3250-
daddr = &combined->ip6.saddr;
3250+
daddr = &combined->ip6.daddr;
32513251

32523252
slave_dbg(bond->dev, slave->dev, "%s: %s/%d av %d sv %d sip %pI6c tip %pI6c\n",
32533253
__func__, slave->dev->name, bond_slave_state(slave),

drivers/net/can/can327.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,9 @@ static int can327_netdev_close(struct net_device *dev)
796796

797797
netif_stop_queue(dev);
798798

799-
/* Give UART one final chance to flush. */
800-
clear_bit(TTY_DO_WRITE_WAKEUP, &elm->tty->flags);
801-
flush_work(&elm->tx_work);
799+
/* We don't flush the UART TX queue here, as we want final stop
800+
* commands (like the above dummy char) to be flushed out.
801+
*/
802802

803803
can_rx_offload_disable(&elm->offload);
804804
elm->can.state = CAN_STATE_STOPPED;
@@ -1069,12 +1069,15 @@ static void can327_ldisc_close(struct tty_struct *tty)
10691069
{
10701070
struct can327 *elm = (struct can327 *)tty->disc_data;
10711071

1072-
/* unregister_netdev() calls .ndo_stop() so we don't have to.
1073-
* Our .ndo_stop() also flushes the TTY write wakeup handler,
1074-
* so we can safely set elm->tty = NULL after this.
1075-
*/
1072+
/* unregister_netdev() calls .ndo_stop() so we don't have to. */
10761073
unregister_candev(elm->dev);
10771074

1075+
/* Give UART one final chance to flush.
1076+
* No need to clear TTY_DO_WRITE_WAKEUP since .write_wakeup() is
1077+
* serialised against .close() and will not be called once we return.
1078+
*/
1079+
flush_work(&elm->tx_work);
1080+
10781081
/* Mark channel as dead */
10791082
spin_lock_bh(&elm->lock);
10801083
tty->disc_data = NULL;

drivers/net/can/slcan/slcan-core.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,12 +864,14 @@ static void slcan_close(struct tty_struct *tty)
864864
{
865865
struct slcan *sl = (struct slcan *)tty->disc_data;
866866

867-
/* unregister_netdev() calls .ndo_stop() so we don't have to.
868-
* Our .ndo_stop() also flushes the TTY write wakeup handler,
869-
* so we can safely set sl->tty = NULL after this.
870-
*/
871867
unregister_candev(sl->dev);
872868

869+
/*
870+
* The netdev needn't be UP (so .ndo_stop() is not called). Hence make
871+
* sure this is not running before freeing it up.
872+
*/
873+
flush_work(&sl->tx_work);
874+
873875
/* Mark channel as dead */
874876
spin_lock_bh(&sl->lock);
875877
tty->disc_data = NULL;

drivers/net/can/usb/esd_usb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
234234
u8 rxerr = msg->msg.rx.data[2];
235235
u8 txerr = msg->msg.rx.data[3];
236236

237+
netdev_dbg(priv->netdev,
238+
"CAN_ERR_EV_EXT: dlc=%#02x state=%02x ecc=%02x rec=%02x tec=%02x\n",
239+
msg->msg.rx.dlc, state, ecc, rxerr, txerr);
240+
237241
skb = alloc_can_err_skb(priv->netdev, &cf);
238242
if (skb == NULL) {
239243
stats->rx_dropped++;
@@ -260,6 +264,8 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
260264
break;
261265
default:
262266
priv->can.state = CAN_STATE_ERROR_ACTIVE;
267+
txerr = 0;
268+
rxerr = 0;
263269
break;
264270
}
265271
} else {

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,13 @@ static void mv88e6xxx_get_caps(struct dsa_switch *ds, int port,
833833

834834
chip->info->ops->phylink_get_caps(chip, port, config);
835835

836-
/* Internal ports need GMII for PHYLIB */
837-
if (mv88e6xxx_phy_is_internal(ds, port))
836+
if (mv88e6xxx_phy_is_internal(ds, port)) {
837+
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
838+
config->supported_interfaces);
839+
/* Internal ports with no phy-mode need GMII for PHYLIB */
838840
__set_bit(PHY_INTERFACE_MODE_GMII,
839841
config->supported_interfaces);
842+
}
840843
}
841844

842845
static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,

drivers/net/dsa/sja1105/sja1105_devlink.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ static int sja1105_setup_devlink_regions(struct dsa_switch *ds)
9595
if (IS_ERR(region)) {
9696
while (--i >= 0)
9797
dsa_devlink_region_destroy(priv->regions[i]);
98+
99+
kfree(priv->regions);
98100
return PTR_ERR(region);
99101
}
100102

drivers/net/dsa/sja1105/sja1105_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ static int sja1105_init_l2_policing(struct sja1105_private *priv)
10381038

10391039
policing[bcast].sharindx = port;
10401040
/* Only SJA1110 has multicast policers */
1041-
if (mcast <= table->ops->max_entry_count)
1041+
if (mcast < table->ops->max_entry_count)
10421042
policing[mcast].sharindx = port;
10431043
}
10441044

drivers/net/ethernet/aeroflex/greth.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ static int greth_init_rings(struct greth_private *greth)
258258
if (dma_mapping_error(greth->dev, dma_addr)) {
259259
if (netif_msg_ifup(greth))
260260
dev_err(greth->dev, "Could not create initial DMA mapping\n");
261+
dev_kfree_skb(skb);
261262
goto cleanup;
262263
}
263264
greth->rx_skbuff[i] = skb;

0 commit comments

Comments
 (0)