Skip to content

Commit 291abfe

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Unbalanced locking in mwifiex_process_country_ie, from Brian Norris. 2) Fix thermal zone registration in iwlwifi, from Andrei Otcheretianski. 3) Fix double free_irq in sgi ioc3 eth, from Thomas Bogendoerfer. 4) Use after free in mptcp, from Florian Westphal. 5) Use after free in wireguard's root_remove_peer_lists, from Eric Dumazet. 6) Properly access packets heads in bonding alb code, from Eric Dumazet. 7) Fix data race in skb_queue_len(), from Qian Cai. 8) Fix regression in r8169 on some chips, from Heiner Kallweit. 9) Fix XDP program ref counting in hv_netvsc, from Haiyang Zhang. 10) Certain kinds of set link netlink operations can cause a NULL deref in the ipv6 addrconf code. Fix from Eric Dumazet. 11) Don't cancel uninitialized work queue in drop monitor, from Ido Schimmel. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits) net: thunderx: use proper interface type for RGMII mt76: mt7615: fix max_nss in mt7615_eeprom_parse_hw_cap bpf: Improve bucket_log calculation logic selftests/bpf: Test freeing sockmap/sockhash with a socket in it bpf, sockhash: Synchronize_rcu before free'ing map bpf, sockmap: Don't sleep while holding RCU lock on tear-down bpftool: Don't crash on missing xlated program instructions bpf, sockmap: Check update requirements after locking drop_monitor: Do not cancel uninitialized work item mlxsw: spectrum_dpipe: Add missing error path mlxsw: core: Add validation of hardware device types for MGPIR register mlxsw: spectrum_router: Clear offload indication from IPv6 nexthops on abort selftests: mlxsw: Add test cases for local table route replacement mlxsw: spectrum_router: Prevent incorrect replacement of local table routes net: dsa: microchip: enable module autoprobe ipv6/addrconf: fix potential NULL deref in inet6_set_link_af() dpaa_eth: support all modes with rate adapting PHYs net: stmmac: update pci platform data to use phy_interface net: stmmac: xgmac: fix missing IFF_MULTICAST checki in dwxgmac2_set_filter net: stmmac: fix missing IFF_MULTICAST check in dwmac4_set_filter ...
2 parents d4f309c + 29ca3b3 commit 291abfe

File tree

80 files changed

+782
-327
lines changed

Some content is hidden

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

80 files changed

+782
-327
lines changed

drivers/net/bonding/bond_alb.c

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,26 +1383,31 @@ netdev_tx_t bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
13831383
bool do_tx_balance = true;
13841384
u32 hash_index = 0;
13851385
const u8 *hash_start = NULL;
1386-
struct ipv6hdr *ip6hdr;
13871386

13881387
skb_reset_mac_header(skb);
13891388
eth_data = eth_hdr(skb);
13901389

13911390
switch (ntohs(skb->protocol)) {
13921391
case ETH_P_IP: {
1393-
const struct iphdr *iph = ip_hdr(skb);
1392+
const struct iphdr *iph;
13941393

13951394
if (is_broadcast_ether_addr(eth_data->h_dest) ||
1396-
iph->daddr == ip_bcast ||
1397-
iph->protocol == IPPROTO_IGMP) {
1395+
!pskb_network_may_pull(skb, sizeof(*iph))) {
1396+
do_tx_balance = false;
1397+
break;
1398+
}
1399+
iph = ip_hdr(skb);
1400+
if (iph->daddr == ip_bcast || iph->protocol == IPPROTO_IGMP) {
13981401
do_tx_balance = false;
13991402
break;
14001403
}
14011404
hash_start = (char *)&(iph->daddr);
14021405
hash_size = sizeof(iph->daddr);
1403-
}
14041406
break;
1405-
case ETH_P_IPV6:
1407+
}
1408+
case ETH_P_IPV6: {
1409+
const struct ipv6hdr *ip6hdr;
1410+
14061411
/* IPv6 doesn't really use broadcast mac address, but leave
14071412
* that here just in case.
14081413
*/
@@ -1419,7 +1424,11 @@ netdev_tx_t bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
14191424
break;
14201425
}
14211426

1422-
/* Additianally, DAD probes should not be tx-balanced as that
1427+
if (!pskb_network_may_pull(skb, sizeof(*ip6hdr))) {
1428+
do_tx_balance = false;
1429+
break;
1430+
}
1431+
/* Additionally, DAD probes should not be tx-balanced as that
14231432
* will lead to false positives for duplicate addresses and
14241433
* prevent address configuration from working.
14251434
*/
@@ -1429,17 +1438,26 @@ netdev_tx_t bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
14291438
break;
14301439
}
14311440

1432-
hash_start = (char *)&(ipv6_hdr(skb)->daddr);
1433-
hash_size = sizeof(ipv6_hdr(skb)->daddr);
1441+
hash_start = (char *)&ip6hdr->daddr;
1442+
hash_size = sizeof(ip6hdr->daddr);
14341443
break;
1435-
case ETH_P_IPX:
1436-
if (ipx_hdr(skb)->ipx_checksum != IPX_NO_CHECKSUM) {
1444+
}
1445+
case ETH_P_IPX: {
1446+
const struct ipxhdr *ipxhdr;
1447+
1448+
if (pskb_network_may_pull(skb, sizeof(*ipxhdr))) {
1449+
do_tx_balance = false;
1450+
break;
1451+
}
1452+
ipxhdr = (struct ipxhdr *)skb_network_header(skb);
1453+
1454+
if (ipxhdr->ipx_checksum != IPX_NO_CHECKSUM) {
14371455
/* something is wrong with this packet */
14381456
do_tx_balance = false;
14391457
break;
14401458
}
14411459

1442-
if (ipx_hdr(skb)->ipx_type != IPX_TYPE_NCP) {
1460+
if (ipxhdr->ipx_type != IPX_TYPE_NCP) {
14431461
/* The only protocol worth balancing in
14441462
* this family since it has an "ARP" like
14451463
* mechanism
@@ -1448,9 +1466,11 @@ netdev_tx_t bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
14481466
break;
14491467
}
14501468

1469+
eth_data = eth_hdr(skb);
14511470
hash_start = (char *)eth_data->h_dest;
14521471
hash_size = ETH_ALEN;
14531472
break;
1473+
}
14541474
case ETH_P_ARP:
14551475
do_tx_balance = false;
14561476
if (bond_info->rlb_enabled)

drivers/net/dsa/b53/b53_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ int b53_configure_vlan(struct dsa_switch *ds)
693693
b53_do_vlan_op(dev, VTA_CMD_CLEAR);
694694
}
695695

696-
b53_enable_vlan(dev, false, ds->vlan_filtering);
696+
b53_enable_vlan(dev, dev->vlan_enabled, ds->vlan_filtering);
697697

698698
b53_for_each_port(dev, i)
699699
b53_write16(dev, B53_VLAN_PAGE,

drivers/net/dsa/bcm_sf2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)
6868

6969
/* Force link status for IMP port */
7070
reg = core_readl(priv, offset);
71-
reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G);
71+
reg |= (MII_SW_OR | LINK_STS);
72+
if (priv->type == BCM7278_DEVICE_ID)
73+
reg |= GMII_SPEED_UP_2G;
7274
core_writel(priv, reg, offset);
7375

7476
/* Enable Broadcast, Multicast, Unicast forwarding to IMP port */

drivers/net/dsa/microchip/ksz9477_spi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ static struct spi_driver ksz9477_spi_driver = {
101101

102102
module_spi_driver(ksz9477_spi_driver);
103103

104+
MODULE_ALIAS("spi:ksz9477");
105+
MODULE_ALIAS("spi:ksz9897");
106+
MODULE_ALIAS("spi:ksz9893");
107+
MODULE_ALIAS("spi:ksz9563");
108+
MODULE_ALIAS("spi:ksz8563");
109+
MODULE_ALIAS("spi:ksz9567");
104110
MODULE_AUTHOR("Woojung Huh <[email protected]>");
105111
MODULE_DESCRIPTION("Microchip KSZ9477 Series Switch SPI access Driver");
106112
MODULE_LICENSE("GPL");

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,6 +2736,9 @@ static int __maybe_unused bcm_sysport_resume(struct device *d)
27362736

27372737
umac_reset(priv);
27382738

2739+
/* Disable the UniMAC RX/TX */
2740+
umac_enable_set(priv, CMD_RX_EN | CMD_TX_EN, 0);
2741+
27392742
/* We may have been suspended and never received a WOL event that
27402743
* would turn off MPD detection, take care of that now
27412744
*/

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ struct sifive_fu540_macb_mgmt {
7373
/* Max length of transmit frame must be a multiple of 8 bytes */
7474
#define MACB_TX_LEN_ALIGN 8
7575
#define MACB_MAX_TX_LEN ((unsigned int)((1 << MACB_TX_FRMLEN_SIZE) - 1) & ~((unsigned int)(MACB_TX_LEN_ALIGN - 1)))
76-
#define GEM_MAX_TX_LEN ((unsigned int)((1 << GEM_TX_FRMLEN_SIZE) - 1) & ~((unsigned int)(MACB_TX_LEN_ALIGN - 1)))
76+
/* Limit maximum TX length as per Cadence TSO errata. This is to avoid a
77+
* false amba_error in TX path from the DMA assuming there is not enough
78+
* space in the SRAM (16KB) even when there is.
79+
*/
80+
#define GEM_MAX_TX_LEN (unsigned int)(0x3FC0)
7781

7882
#define GEM_MTU_MIN_SIZE ETH_MIN_MTU
7983
#define MACB_NETIF_LSO NETIF_F_TSO
@@ -1791,16 +1795,14 @@ static netdev_features_t macb_features_check(struct sk_buff *skb,
17911795

17921796
/* Validate LSO compatibility */
17931797

1794-
/* there is only one buffer */
1795-
if (!skb_is_nonlinear(skb))
1798+
/* there is only one buffer or protocol is not UDP */
1799+
if (!skb_is_nonlinear(skb) || (ip_hdr(skb)->protocol != IPPROTO_UDP))
17961800
return features;
17971801

17981802
/* length of header */
17991803
hdrlen = skb_transport_offset(skb);
1800-
if (ip_hdr(skb)->protocol == IPPROTO_TCP)
1801-
hdrlen += tcp_hdrlen(skb);
18021804

1803-
/* For LSO:
1805+
/* For UFO only:
18041806
* When software supplies two or more payload buffers all payload buffers
18051807
* apart from the last must be a multiple of 8 bytes in size.
18061808
*/

drivers/net/ethernet/cavium/thunder/thunder_bgx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ static int phy_interface_mode(u8 lmac_type)
10391039
if (lmac_type == BGX_MODE_QSGMII)
10401040
return PHY_INTERFACE_MODE_QSGMII;
10411041
if (lmac_type == BGX_MODE_RGMII)
1042-
return PHY_INTERFACE_MODE_RGMII;
1042+
return PHY_INTERFACE_MODE_RGMII_RXID;
10431043

10441044
return PHY_INTERFACE_MODE_SGMII;
10451045
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3403,6 +3403,13 @@ static int chcr_stats_show(struct seq_file *seq, void *v)
34033403
atomic_read(&adap->chcr_stats.fallback));
34043404
seq_printf(seq, "IPSec PDU: %10u\n",
34053405
atomic_read(&adap->chcr_stats.ipsec_cnt));
3406+
seq_printf(seq, "TLS PDU Tx: %10u\n",
3407+
atomic_read(&adap->chcr_stats.tls_pdu_tx));
3408+
seq_printf(seq, "TLS PDU Rx: %10u\n",
3409+
atomic_read(&adap->chcr_stats.tls_pdu_rx));
3410+
seq_printf(seq, "TLS Keys (DDR) Count: %10u\n",
3411+
atomic_read(&adap->chcr_stats.tls_key));
3412+
34063413
return 0;
34073414
}
34083415
DEFINE_SHOW_ATTRIBUTE(chcr_stats);

drivers/net/ethernet/dec/tulip/de2104x.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,10 @@ static void de_rx (struct de_private *de)
417417
if (status & DescOwn)
418418
break;
419419

420-
len = ((status >> 16) & 0x7ff) - 4;
420+
/* the length is actually a 15 bit value here according
421+
* to Table 4-1 in the DE2104x spec so mask is 0x7fff
422+
*/
423+
len = ((status >> 16) & 0x7fff) - 4;
421424
mapping = de->rx_skb[rx_tail].mapping;
422425

423426
if (unlikely(drop)) {

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,6 +2453,9 @@ static void dpaa_adjust_link(struct net_device *net_dev)
24532453
mac_dev->adjust_link(mac_dev);
24542454
}
24552455

2456+
/* The Aquantia PHYs are capable of performing rate adaptation */
2457+
#define PHY_VEND_AQUANTIA 0x03a1b400
2458+
24562459
static int dpaa_phy_init(struct net_device *net_dev)
24572460
{
24582461
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
@@ -2471,9 +2474,14 @@ static int dpaa_phy_init(struct net_device *net_dev)
24712474
return -ENODEV;
24722475
}
24732476

2474-
/* Remove any features not supported by the controller */
2475-
ethtool_convert_legacy_u32_to_link_mode(mask, mac_dev->if_support);
2476-
linkmode_and(phy_dev->supported, phy_dev->supported, mask);
2477+
/* Unless the PHY is capable of rate adaptation */
2478+
if (mac_dev->phy_if != PHY_INTERFACE_MODE_XGMII ||
2479+
((phy_dev->drv->phy_id & GENMASK(31, 10)) != PHY_VEND_AQUANTIA)) {
2480+
/* remove any features not supported by the controller */
2481+
ethtool_convert_legacy_u32_to_link_mode(mask,
2482+
mac_dev->if_support);
2483+
linkmode_and(phy_dev->supported, phy_dev->supported, mask);
2484+
}
24772485

24782486
phy_support_asym_pause(phy_dev);
24792487

0 commit comments

Comments
 (0)