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.10-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Jakub Kicinski:
"Current release - regressions:

- virtio_net: fix missed error path rtnl_unlock after control queue
locking rework

Current release - new code bugs:

- bpf: fix KASAN slab-out-of-bounds in percpu_array_map_gen_lookup,
caused by missing nested map handling

- drv: dsa: correct initialization order for KSZ88x3 ports

Previous releases - regressions:

- af_packet: do not call packet_read_pending() from
tpacket_destruct_skb() fix performance regression

- ipv6: fix route deleting failure when metric equals 0, don't assume
0 means not set / default in this case

Previous releases - always broken:

- bridge: couple of syzbot-driven fixes"

* tag 'net-6.10-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (30 commits)
selftests: net: local_termination: annotate the expected failures
net: dsa: microchip: Correct initialization order for KSZ88x3 ports
MAINTAINERS: net: Update reviewers for TI's Ethernet drivers
dt-bindings: net: ti: Update maintainers list
l2tp: fix ICMP error handling for UDP-encap sockets
net: txgbe: fix to control VLAN strip
net: wangxun: match VLAN CTAG and STAG features
net: wangxun: fix to change Rx features
af_packet: do not call packet_read_pending() from tpacket_destruct_skb()
virtio_net: Fix missed rtnl_unlock
netrom: fix possible dead-lock in nr_rt_ioctl()
idpf: don't skip over ethtool tcp-data-split setting
dt-bindings: net: qcom: ethernet: Allow dma-coherent
bonding: fix oops during rmmod
net/ipv6: Fix route deleting failure when metric equals 0
selftests/net: reduce xfrm_policy test time
selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations
selftests/bpf: Adjust test_access_variable_array after a kernel function name change
selftests/net/lib: no need to record ns name if it already exist
net: qrtr: ns: Fix module refcnt
...

+304 -110
+3 -2
Documentation/bpf/standardization/instruction-set.rst
··· 301 301 ``ALU`` uses 32-bit wide operands while ``ALU64`` uses 64-bit wide operands for 302 302 otherwise identical operations. ``ALU64`` instructions belong to the 303 303 base64 conformance group unless noted otherwise. 304 - The 'code' field encodes the operation as below, where 'src' and 'dst' refer 305 - to the values of the source and destination registers, respectively. 304 + The 'code' field encodes the operation as below, where 'src' refers to the 305 + the source operand and 'dst' refers to the value of the destination 306 + register. 306 307 307 308 ===== ===== ======= ========================================================== 308 309 name code offset description
+2
Documentation/devicetree/bindings/net/qcom,ethqos.yaml
··· 61 61 iommus: 62 62 maxItems: 1 63 63 64 + dma-coherent: true 65 + 64 66 phys: true 65 67 66 68 phy-names:
-1
Documentation/devicetree/bindings/net/ti,cpsw-switch.yaml
··· 8 8 9 9 maintainers: 10 10 - Siddharth Vadapalli <s-vadapalli@ti.com> 11 - - Ravi Gunasekaran <r-gunasekaran@ti.com> 12 11 - Roger Quadros <rogerq@kernel.org> 13 12 14 13 description:
-1
Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml
··· 8 8 9 9 maintainers: 10 10 - Siddharth Vadapalli <s-vadapalli@ti.com> 11 - - Ravi Gunasekaran <r-gunasekaran@ti.com> 12 11 - Roger Quadros <rogerq@kernel.org> 13 12 14 13 description:
-1
Documentation/devicetree/bindings/net/ti,k3-am654-cpts.yaml
··· 8 8 9 9 maintainers: 10 10 - Siddharth Vadapalli <s-vadapalli@ti.com> 11 - - Ravi Gunasekaran <r-gunasekaran@ti.com> 12 11 - Roger Quadros <rogerq@kernel.org> 13 12 14 13 description: |+
+1 -2
MAINTAINERS
··· 3815 3815 BPF JIT for ARM64 3816 3816 M: Daniel Borkmann <daniel@iogearbox.net> 3817 3817 M: Alexei Starovoitov <ast@kernel.org> 3818 - M: Zi Shen Lim <zlim.lnx@gmail.com> 3818 + M: Puranjay Mohan <puranjay@kernel.org> 3819 3819 L: bpf@vger.kernel.org 3820 3820 S: Supported 3821 3821 F: arch/arm64/net/ ··· 22392 22392 22393 22393 TI ETHERNET SWITCH DRIVER (CPSW) 22394 22394 R: Siddharth Vadapalli <s-vadapalli@ti.com> 22395 - R: Ravi Gunasekaran <r-gunasekaran@ti.com> 22396 22395 R: Roger Quadros <rogerq@kernel.org> 22397 22396 L: linux-omap@vger.kernel.org 22398 22397 L: netdev@vger.kernel.org
+7 -6
drivers/net/bonding/bond_main.c
··· 6477 6477 if (res) 6478 6478 goto out; 6479 6479 6480 + bond_create_debugfs(); 6481 + 6480 6482 res = register_pernet_subsys(&bond_net_ops); 6481 6483 if (res) 6482 - goto out; 6484 + goto err_net_ops; 6483 6485 6484 6486 res = bond_netlink_init(); 6485 6487 if (res) 6486 6488 goto err_link; 6487 - 6488 - bond_create_debugfs(); 6489 6489 6490 6490 for (i = 0; i < max_bonds; i++) { 6491 6491 res = bond_create(&init_net, NULL); ··· 6501 6501 out: 6502 6502 return res; 6503 6503 err: 6504 - bond_destroy_debugfs(); 6505 6504 bond_netlink_fini(); 6506 6505 err_link: 6507 6506 unregister_pernet_subsys(&bond_net_ops); 6507 + err_net_ops: 6508 + bond_destroy_debugfs(); 6508 6509 goto out; 6509 6510 6510 6511 } ··· 6514 6513 { 6515 6514 unregister_netdevice_notifier(&bond_netdev_notifier); 6516 6515 6517 - bond_destroy_debugfs(); 6518 - 6519 6516 bond_netlink_fini(); 6520 6517 unregister_pernet_subsys(&bond_net_ops); 6518 + 6519 + bond_destroy_debugfs(); 6521 6520 6522 6521 #ifdef CONFIG_NET_POLL_CONTROLLER 6523 6522 /* Make sure we don't have an imbalance on our netpoll blocking */
+10
drivers/net/dsa/microchip/ksz_dcb.c
··· 805 805 if (ret) 806 806 return ret; 807 807 808 + /* Enable 802.1p priority control on Port 2 during switch initialization. 809 + * This setup is critical for the apptrust functionality on Port 1, which 810 + * relies on the priority settings of Port 2. Note: Port 1 is naturally 811 + * configured before Port 2, necessitating this configuration order. 812 + */ 813 + if (ksz_is_ksz88x3(dev)) 814 + return ksz_prmw8(dev, KSZ_PORT_2, KSZ8_REG_PORT_1_CTRL_0, 815 + KSZ8_PORT_802_1P_ENABLE, 816 + KSZ8_PORT_802_1P_ENABLE); 817 + 808 818 return 0; 809 819 }
+2 -1
drivers/net/ethernet/intel/idpf/idpf_ethtool.c
··· 376 376 new_tx_count); 377 377 378 378 if (new_tx_count == vport->txq_desc_count && 379 - new_rx_count == vport->rxq_desc_count) 379 + new_rx_count == vport->rxq_desc_count && 380 + kring->tcp_data_split == idpf_vport_get_hsplit(vport)) 380 381 goto unlock_mutex; 381 382 382 383 if (!idpf_vport_set_hsplit(vport, kring->tcp_data_split)) {
+1 -17
drivers/net/ethernet/micrel/ks8851_common.c
··· 328 328 { 329 329 struct ks8851_net *ks = _ks; 330 330 struct sk_buff_head rxq; 331 - unsigned handled = 0; 332 331 unsigned long flags; 333 332 unsigned int status; 334 333 struct sk_buff *skb; ··· 335 336 ks8851_lock(ks, &flags); 336 337 337 338 status = ks8851_rdreg16(ks, KS_ISR); 339 + ks8851_wrreg16(ks, KS_ISR, status); 338 340 339 341 netif_dbg(ks, intr, ks->netdev, 340 342 "%s: status 0x%04x\n", __func__, status); 341 - 342 - if (status & IRQ_LCI) 343 - handled |= IRQ_LCI; 344 343 345 344 if (status & IRQ_LDI) { 346 345 u16 pmecr = ks8851_rdreg16(ks, KS_PMECR); 347 346 pmecr &= ~PMECR_WKEVT_MASK; 348 347 ks8851_wrreg16(ks, KS_PMECR, pmecr | PMECR_WKEVT_LINK); 349 - 350 - handled |= IRQ_LDI; 351 348 } 352 - 353 - if (status & IRQ_RXPSI) 354 - handled |= IRQ_RXPSI; 355 349 356 350 if (status & IRQ_TXI) { 357 351 unsigned short tx_space = ks8851_rdreg16(ks, KS_TXMIR); ··· 357 365 if (netif_queue_stopped(ks->netdev)) 358 366 netif_wake_queue(ks->netdev); 359 367 spin_unlock(&ks->statelock); 360 - 361 - handled |= IRQ_TXI; 362 368 } 363 - 364 - if (status & IRQ_RXI) 365 - handled |= IRQ_RXI; 366 369 367 370 if (status & IRQ_SPIBEI) { 368 371 netdev_err(ks->netdev, "%s: spi bus error\n", __func__); 369 - handled |= IRQ_SPIBEI; 370 372 } 371 - 372 - ks8851_wrreg16(ks, KS_ISR, handled); 373 373 374 374 if (status & IRQ_RXI) { 375 375 /* the datasheet says to disable the rx interrupt during
+4 -2
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
··· 1087 1087 platform_set_drvdata(pdev, lan966x); 1088 1088 lan966x->dev = &pdev->dev; 1089 1089 1090 - lan966x->debugfs_root = debugfs_create_dir("lan966x", NULL); 1091 - 1092 1090 if (!device_get_mac_address(&pdev->dev, mac_addr)) { 1093 1091 ether_addr_copy(lan966x->base_mac, mac_addr); 1094 1092 } else { ··· 1177 1179 return dev_err_probe(&pdev->dev, -ENODEV, 1178 1180 "no ethernet-ports child found\n"); 1179 1181 1182 + lan966x->debugfs_root = debugfs_create_dir("lan966x", NULL); 1183 + 1180 1184 /* init switch */ 1181 1185 lan966x_init(lan966x); 1182 1186 lan966x_stats_init(lan966x); ··· 1256 1256 cancel_delayed_work_sync(&lan966x->stats_work); 1257 1257 destroy_workqueue(lan966x->stats_queue); 1258 1258 mutex_destroy(&lan966x->stats_lock); 1259 + 1260 + debugfs_remove_recursive(lan966x->debugfs_root); 1259 1261 1260 1262 return err; 1261 1263 }
+2
drivers/net/ethernet/wangxun/libwx/wx_hw.c
··· 1958 1958 return -ENOMEM; 1959 1959 } 1960 1960 1961 + bitmap_zero(wx->state, WX_STATE_NBITS); 1962 + 1961 1963 return 0; 1962 1964 } 1963 1965 EXPORT_SYMBOL(wx_sw_init);
+52 -4
drivers/net/ethernet/wangxun/libwx/wx_lib.c
··· 2690 2690 wx->rss_enabled = false; 2691 2691 } 2692 2692 2693 - if (changed & 2694 - (NETIF_F_HW_VLAN_CTAG_RX | 2695 - NETIF_F_HW_VLAN_STAG_RX)) 2693 + netdev->features = features; 2694 + 2695 + if (wx->mac.type == wx_mac_sp && changed & NETIF_F_HW_VLAN_CTAG_RX) 2696 + wx->do_reset(netdev); 2697 + else if (changed & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER)) 2696 2698 wx_set_rx_mode(netdev); 2697 2699 2698 - return 1; 2700 + return 0; 2699 2701 } 2700 2702 EXPORT_SYMBOL(wx_set_features); 2703 + 2704 + #define NETIF_VLAN_STRIPPING_FEATURES (NETIF_F_HW_VLAN_CTAG_RX | \ 2705 + NETIF_F_HW_VLAN_STAG_RX) 2706 + 2707 + #define NETIF_VLAN_INSERTION_FEATURES (NETIF_F_HW_VLAN_CTAG_TX | \ 2708 + NETIF_F_HW_VLAN_STAG_TX) 2709 + 2710 + #define NETIF_VLAN_FILTERING_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \ 2711 + NETIF_F_HW_VLAN_STAG_FILTER) 2712 + 2713 + netdev_features_t wx_fix_features(struct net_device *netdev, 2714 + netdev_features_t features) 2715 + { 2716 + netdev_features_t changed = netdev->features ^ features; 2717 + struct wx *wx = netdev_priv(netdev); 2718 + 2719 + if (changed & NETIF_VLAN_STRIPPING_FEATURES) { 2720 + if ((features & NETIF_VLAN_STRIPPING_FEATURES) != NETIF_VLAN_STRIPPING_FEATURES && 2721 + (features & NETIF_VLAN_STRIPPING_FEATURES) != 0) { 2722 + features &= ~NETIF_VLAN_STRIPPING_FEATURES; 2723 + features |= netdev->features & NETIF_VLAN_STRIPPING_FEATURES; 2724 + wx_err(wx, "802.1Q and 802.1ad VLAN stripping must be either both on or both off."); 2725 + } 2726 + } 2727 + 2728 + if (changed & NETIF_VLAN_INSERTION_FEATURES) { 2729 + if ((features & NETIF_VLAN_INSERTION_FEATURES) != NETIF_VLAN_INSERTION_FEATURES && 2730 + (features & NETIF_VLAN_INSERTION_FEATURES) != 0) { 2731 + features &= ~NETIF_VLAN_INSERTION_FEATURES; 2732 + features |= netdev->features & NETIF_VLAN_INSERTION_FEATURES; 2733 + wx_err(wx, "802.1Q and 802.1ad VLAN insertion must be either both on or both off."); 2734 + } 2735 + } 2736 + 2737 + if (changed & NETIF_VLAN_FILTERING_FEATURES) { 2738 + if ((features & NETIF_VLAN_FILTERING_FEATURES) != NETIF_VLAN_FILTERING_FEATURES && 2739 + (features & NETIF_VLAN_FILTERING_FEATURES) != 0) { 2740 + features &= ~NETIF_VLAN_FILTERING_FEATURES; 2741 + features |= netdev->features & NETIF_VLAN_FILTERING_FEATURES; 2742 + wx_err(wx, "802.1Q and 802.1ad VLAN filtering must be either both on or both off."); 2743 + } 2744 + } 2745 + 2746 + return features; 2747 + } 2748 + EXPORT_SYMBOL(wx_fix_features); 2701 2749 2702 2750 void wx_set_ring(struct wx *wx, u32 new_tx_count, 2703 2751 u32 new_rx_count, struct wx_ring *temp_ring)
+2
drivers/net/ethernet/wangxun/libwx/wx_lib.h
··· 30 30 void wx_get_stats64(struct net_device *netdev, 31 31 struct rtnl_link_stats64 *stats); 32 32 int wx_set_features(struct net_device *netdev, netdev_features_t features); 33 + netdev_features_t wx_fix_features(struct net_device *netdev, 34 + netdev_features_t features); 33 35 void wx_set_ring(struct wx *wx, u32 new_tx_count, 34 36 u32 new_rx_count, struct wx_ring *temp_ring); 35 37
+22
drivers/net/ethernet/wangxun/libwx/wx_type.h
··· 982 982 u64 qmprc; 983 983 }; 984 984 985 + enum wx_state { 986 + WX_STATE_RESETTING, 987 + WX_STATE_NBITS, /* must be last */ 988 + }; 985 989 struct wx { 986 990 unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; 991 + DECLARE_BITMAP(state, WX_STATE_NBITS); 987 992 988 993 void *priv; 989 994 u8 __iomem *hw_addr; ··· 1076 1071 u64 hw_csum_rx_good; 1077 1072 u64 hw_csum_rx_error; 1078 1073 u64 alloc_rx_buff_failed; 1074 + 1075 + void (*do_reset)(struct net_device *netdev); 1079 1076 }; 1080 1077 1081 1078 #define WX_INTR_ALL (~0ULL) ··· 1136 1129 static inline struct wx *phylink_to_wx(struct phylink_config *config) 1137 1130 { 1138 1131 return container_of(config, struct wx, phylink_config); 1132 + } 1133 + 1134 + static inline int wx_set_state_reset(struct wx *wx) 1135 + { 1136 + u8 timeout = 50; 1137 + 1138 + while (test_and_set_bit(WX_STATE_RESETTING, wx->state)) { 1139 + timeout--; 1140 + if (!timeout) 1141 + return -EBUSY; 1142 + 1143 + usleep_range(1000, 2000); 1144 + } 1145 + 1146 + return 0; 1139 1147 } 1140 1148 1141 1149 #endif /* _WX_TYPE_H_ */
+13 -5
drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c
··· 52 52 struct wx *wx = netdev_priv(netdev); 53 53 u32 new_rx_count, new_tx_count; 54 54 struct wx_ring *temp_ring; 55 - int i; 55 + int i, err = 0; 56 56 57 57 new_tx_count = clamp_t(u32, ring->tx_pending, WX_MIN_TXD, WX_MAX_TXD); 58 58 new_tx_count = ALIGN(new_tx_count, WX_REQ_TX_DESCRIPTOR_MULTIPLE); ··· 64 64 new_rx_count == wx->rx_ring_count) 65 65 return 0; 66 66 67 + err = wx_set_state_reset(wx); 68 + if (err) 69 + return err; 70 + 67 71 if (!netif_running(wx->netdev)) { 68 72 for (i = 0; i < wx->num_tx_queues; i++) 69 73 wx->tx_ring[i]->count = new_tx_count; ··· 76 72 wx->tx_ring_count = new_tx_count; 77 73 wx->rx_ring_count = new_rx_count; 78 74 79 - return 0; 75 + goto clear_reset; 80 76 } 81 77 82 78 /* allocate temporary buffer to store rings in */ 83 79 i = max_t(int, wx->num_tx_queues, wx->num_rx_queues); 84 80 temp_ring = kvmalloc_array(i, sizeof(struct wx_ring), GFP_KERNEL); 85 - if (!temp_ring) 86 - return -ENOMEM; 81 + if (!temp_ring) { 82 + err = -ENOMEM; 83 + goto clear_reset; 84 + } 87 85 88 86 ngbe_down(wx); 89 87 ··· 95 89 wx_configure(wx); 96 90 ngbe_up(wx); 97 91 98 - return 0; 92 + clear_reset: 93 + clear_bit(WX_STATE_RESETTING, wx->state); 94 + return err; 99 95 } 100 96 101 97 static int ngbe_set_channels(struct net_device *dev,
+1
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
··· 499 499 .ndo_start_xmit = wx_xmit_frame, 500 500 .ndo_set_rx_mode = wx_set_rx_mode, 501 501 .ndo_set_features = wx_set_features, 502 + .ndo_fix_features = wx_fix_features, 502 503 .ndo_validate_addr = eth_validate_addr, 503 504 .ndo_set_mac_address = wx_set_mac, 504 505 .ndo_get_stats64 = wx_get_stats64,
+13 -5
drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c
··· 19 19 struct wx *wx = netdev_priv(netdev); 20 20 u32 new_rx_count, new_tx_count; 21 21 struct wx_ring *temp_ring; 22 - int i; 22 + int i, err = 0; 23 23 24 24 new_tx_count = clamp_t(u32, ring->tx_pending, WX_MIN_TXD, WX_MAX_TXD); 25 25 new_tx_count = ALIGN(new_tx_count, WX_REQ_TX_DESCRIPTOR_MULTIPLE); ··· 31 31 new_rx_count == wx->rx_ring_count) 32 32 return 0; 33 33 34 + err = wx_set_state_reset(wx); 35 + if (err) 36 + return err; 37 + 34 38 if (!netif_running(wx->netdev)) { 35 39 for (i = 0; i < wx->num_tx_queues; i++) 36 40 wx->tx_ring[i]->count = new_tx_count; ··· 43 39 wx->tx_ring_count = new_tx_count; 44 40 wx->rx_ring_count = new_rx_count; 45 41 46 - return 0; 42 + goto clear_reset; 47 43 } 48 44 49 45 /* allocate temporary buffer to store rings in */ 50 46 i = max_t(int, wx->num_tx_queues, wx->num_rx_queues); 51 47 temp_ring = kvmalloc_array(i, sizeof(struct wx_ring), GFP_KERNEL); 52 - if (!temp_ring) 53 - return -ENOMEM; 48 + if (!temp_ring) { 49 + err = -ENOMEM; 50 + goto clear_reset; 51 + } 54 52 55 53 txgbe_down(wx); 56 54 ··· 61 55 62 56 txgbe_up(wx); 63 57 64 - return 0; 58 + clear_reset: 59 + clear_bit(WX_STATE_RESETTING, wx->state); 60 + return err; 65 61 } 66 62 67 63 static int txgbe_set_channels(struct net_device *dev,
+31
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
··· 269 269 wx->tx_work_limit = TXGBE_DEFAULT_TX_WORK; 270 270 wx->rx_work_limit = TXGBE_DEFAULT_RX_WORK; 271 271 272 + wx->do_reset = txgbe_do_reset; 273 + 272 274 return 0; 273 275 } 274 276 ··· 423 421 return 0; 424 422 } 425 423 424 + static void txgbe_reinit_locked(struct wx *wx) 425 + { 426 + int err = 0; 427 + 428 + netif_trans_update(wx->netdev); 429 + 430 + err = wx_set_state_reset(wx); 431 + if (err) { 432 + wx_err(wx, "wait device reset timeout\n"); 433 + return; 434 + } 435 + 436 + txgbe_down(wx); 437 + txgbe_up(wx); 438 + 439 + clear_bit(WX_STATE_RESETTING, wx->state); 440 + } 441 + 442 + void txgbe_do_reset(struct net_device *netdev) 443 + { 444 + struct wx *wx = netdev_priv(netdev); 445 + 446 + if (netif_running(netdev)) 447 + txgbe_reinit_locked(wx); 448 + else 449 + txgbe_reset(wx); 450 + } 451 + 426 452 static const struct net_device_ops txgbe_netdev_ops = { 427 453 .ndo_open = txgbe_open, 428 454 .ndo_stop = txgbe_close, ··· 458 428 .ndo_start_xmit = wx_xmit_frame, 459 429 .ndo_set_rx_mode = wx_set_rx_mode, 460 430 .ndo_set_features = wx_set_features, 431 + .ndo_fix_features = wx_fix_features, 461 432 .ndo_validate_addr = eth_validate_addr, 462 433 .ndo_set_mac_address = wx_set_mac, 463 434 .ndo_get_stats64 = wx_get_stats64,
+1
drivers/net/ethernet/wangxun/txgbe/txgbe_type.h
··· 134 134 void txgbe_down(struct wx *wx); 135 135 void txgbe_up(struct wx *wx); 136 136 int txgbe_setup_tc(struct net_device *dev, u8 tc); 137 + void txgbe_do_reset(struct net_device *netdev); 137 138 138 139 #define NODE_PROP(_NAME, _PROP) \ 139 140 (const struct software_node) { \
+3 -3
drivers/net/virtio_net.c
··· 2902 2902 if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) 2903 2903 return; 2904 2904 2905 - rtnl_lock(); 2906 - 2907 - promisc_allmulti = kzalloc(sizeof(*promisc_allmulti), GFP_ATOMIC); 2905 + promisc_allmulti = kzalloc(sizeof(*promisc_allmulti), GFP_KERNEL); 2908 2906 if (!promisc_allmulti) { 2909 2907 dev_warn(&dev->dev, "Failed to set RX mode, no memory.\n"); 2910 2908 return; 2911 2909 } 2910 + 2911 + rtnl_lock(); 2912 2912 2913 2913 *promisc_allmulti = !!(dev->flags & IFF_PROMISC); 2914 2914 sg_init_one(sg, promisc_allmulti, sizeof(*promisc_allmulti));
+2 -2
kernel/bpf/map_in_map.c
··· 32 32 33 33 inner_map_meta_size = sizeof(*inner_map_meta); 34 34 /* In some cases verifier needs to access beyond just base map. */ 35 - if (inner_map->ops == &array_map_ops) 35 + if (inner_map->ops == &array_map_ops || inner_map->ops == &percpu_array_map_ops) 36 36 inner_map_meta_size = sizeof(struct bpf_array); 37 37 38 38 inner_map_meta = kzalloc(inner_map_meta_size, GFP_USER); ··· 68 68 69 69 /* Misc members not needed in bpf_map_meta_equal() check. */ 70 70 inner_map_meta->ops = inner_map->ops; 71 - if (inner_map->ops == &array_map_ops) { 71 + if (inner_map->ops == &array_map_ops || inner_map->ops == &percpu_array_map_ops) { 72 72 struct bpf_array *inner_array_meta = 73 73 container_of(inner_map_meta, struct bpf_array, map); 74 74 struct bpf_array *inner_array = container_of(inner_map, struct bpf_array, map);
+6
net/bridge/br_device.c
··· 27 27 /* net device transmit always called with BH disabled */ 28 28 netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) 29 29 { 30 + enum skb_drop_reason reason = pskb_may_pull_reason(skb, ETH_HLEN); 30 31 struct net_bridge_mcast_port *pmctx_null = NULL; 31 32 struct net_bridge *br = netdev_priv(dev); 32 33 struct net_bridge_mcast *brmctx = &br->multicast_ctx; ··· 38 37 struct net_bridge_vlan *vlan; 39 38 const unsigned char *dest; 40 39 u16 vid = 0; 40 + 41 + if (unlikely(reason != SKB_NOT_DROPPED_YET)) { 42 + kfree_skb_reason(skb, reason); 43 + return NETDEV_TX_OK; 44 + } 41 45 42 46 memset(skb->cb, 0, sizeof(struct br_input_skb_cb)); 43 47 br_tc_skb_miss_set(skb, false);
+10 -6
net/bridge/br_mst.c
··· 78 78 { 79 79 struct net_bridge_vlan_group *vg = nbp_vlan_group(p); 80 80 81 - if (v->state == state) 81 + if (br_vlan_get_state(v) == state) 82 82 return; 83 83 84 84 br_vlan_set_state(v, state); ··· 100 100 }; 101 101 struct net_bridge_vlan_group *vg; 102 102 struct net_bridge_vlan *v; 103 - int err; 103 + int err = 0; 104 104 105 + rcu_read_lock(); 105 106 vg = nbp_vlan_group(p); 106 107 if (!vg) 107 - return 0; 108 + goto out; 108 109 109 110 /* MSTI 0 (CST) state changes are notified via the regular 110 111 * SWITCHDEV_ATTR_ID_PORT_STP_STATE. ··· 113 112 if (msti) { 114 113 err = switchdev_port_attr_set(p->dev, &attr, extack); 115 114 if (err && err != -EOPNOTSUPP) 116 - return err; 115 + goto out; 117 116 } 118 117 119 - list_for_each_entry(v, &vg->vlan_list, vlist) { 118 + err = 0; 119 + list_for_each_entry_rcu(v, &vg->vlan_list, vlist) { 120 120 if (v->brvlan->msti != msti) 121 121 continue; 122 122 123 123 br_mst_vlan_set_state(p, v, state); 124 124 } 125 125 126 - return 0; 126 + out: 127 + rcu_read_unlock(); 128 + return err; 127 129 } 128 130 129 131 static void br_mst_vlan_sync_state(struct net_bridge_vlan *pv, u16 msti)
+4 -1
net/ipv6/route.c
··· 4445 4445 .fc_table = l3mdev_fib_table_by_index(net, rtmsg->rtmsg_ifindex) ? 4446 4446 : RT6_TABLE_MAIN, 4447 4447 .fc_ifindex = rtmsg->rtmsg_ifindex, 4448 - .fc_metric = rtmsg->rtmsg_metric ? : IP6_RT_PRIO_USER, 4448 + .fc_metric = rtmsg->rtmsg_metric, 4449 4449 .fc_expires = rtmsg->rtmsg_info, 4450 4450 .fc_dst_len = rtmsg->rtmsg_dst_len, 4451 4451 .fc_src_len = rtmsg->rtmsg_src_len, ··· 4475 4475 rtnl_lock(); 4476 4476 switch (cmd) { 4477 4477 case SIOCADDRT: 4478 + /* Only do the default setting of fc_metric in route adding */ 4479 + if (cfg.fc_metric == 0) 4480 + cfg.fc_metric = IP6_RT_PRIO_USER; 4478 4481 err = ip6_route_add(&cfg, GFP_KERNEL, NULL); 4479 4482 break; 4480 4483 case SIOCDELRT:
+33 -11
net/l2tp/l2tp_core.c
··· 910 910 return 1; 911 911 } 912 912 913 - /* UDP encapsulation receive handler. See net/ipv4/udp.c. 914 - * Return codes: 915 - * 0 : success. 916 - * <0: error 917 - * >0: skb should be passed up to userspace as UDP. 913 + /* UDP encapsulation receive and error receive handlers. 914 + * See net/ipv4/udp.c for details. 915 + * 916 + * Note that these functions are called from inside an 917 + * RCU-protected region, but without the socket being locked. 918 + * 919 + * Hence we use rcu_dereference_sk_user_data to access the 920 + * tunnel data structure rather the usual l2tp_sk_to_tunnel 921 + * accessor function. 918 922 */ 919 923 int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) 920 924 { 921 925 struct l2tp_tunnel *tunnel; 922 926 923 - /* Note that this is called from the encap_rcv hook inside an 924 - * RCU-protected region, but without the socket being locked. 925 - * Hence we use rcu_dereference_sk_user_data to access the 926 - * tunnel data structure rather the usual l2tp_sk_to_tunnel 927 - * accessor function. 928 - */ 929 927 tunnel = rcu_dereference_sk_user_data(sk); 930 928 if (!tunnel) 931 929 goto pass_up; ··· 939 941 return 1; 940 942 } 941 943 EXPORT_SYMBOL_GPL(l2tp_udp_encap_recv); 944 + 945 + static void l2tp_udp_encap_err_recv(struct sock *sk, struct sk_buff *skb, int err, 946 + __be16 port, u32 info, u8 *payload) 947 + { 948 + struct l2tp_tunnel *tunnel; 949 + 950 + tunnel = rcu_dereference_sk_user_data(sk); 951 + if (!tunnel || tunnel->fd < 0) 952 + return; 953 + 954 + sk->sk_err = err; 955 + sk_error_report(sk); 956 + 957 + if (ip_hdr(skb)->version == IPVERSION) { 958 + if (inet_test_bit(RECVERR, sk)) 959 + return ip_icmp_error(sk, skb, err, port, info, payload); 960 + #if IS_ENABLED(CONFIG_IPV6) 961 + } else { 962 + if (inet6_test_bit(RECVERR6, sk)) 963 + return ipv6_icmp_error(sk, skb, err, port, info, payload); 964 + #endif 965 + } 966 + } 942 967 943 968 /************************************************************************ 944 969 * Transmit handling ··· 1537 1516 .sk_user_data = tunnel, 1538 1517 .encap_type = UDP_ENCAP_L2TPINUDP, 1539 1518 .encap_rcv = l2tp_udp_encap_recv, 1519 + .encap_err_rcv = l2tp_udp_encap_err_recv, 1540 1520 .encap_destroy = l2tp_udp_encap_destroy, 1541 1521 }; 1542 1522
+7 -12
net/netrom/nr_route.c
··· 285 285 return 0; 286 286 } 287 287 288 - static inline void __nr_remove_node(struct nr_node *nr_node) 288 + static void nr_remove_node_locked(struct nr_node *nr_node) 289 289 { 290 + lockdep_assert_held(&nr_node_list_lock); 291 + 290 292 hlist_del_init(&nr_node->node_node); 291 293 nr_node_put(nr_node); 292 - } 293 - 294 - #define nr_remove_node_locked(__node) \ 295 - __nr_remove_node(__node) 296 - 297 - static void nr_remove_node(struct nr_node *nr_node) 298 - { 299 - spin_lock_bh(&nr_node_list_lock); 300 - __nr_remove_node(nr_node); 301 - spin_unlock_bh(&nr_node_list_lock); 302 294 } 303 295 304 296 static inline void __nr_remove_neigh(struct nr_neigh *nr_neigh) ··· 331 339 return -EINVAL; 332 340 } 333 341 342 + spin_lock_bh(&nr_node_list_lock); 334 343 nr_node_lock(nr_node); 335 344 for (i = 0; i < nr_node->count; i++) { 336 345 if (nr_node->routes[i].neighbour == nr_neigh) { ··· 345 352 nr_node->count--; 346 353 347 354 if (nr_node->count == 0) { 348 - nr_remove_node(nr_node); 355 + nr_remove_node_locked(nr_node); 349 356 } else { 350 357 switch (i) { 351 358 case 0: ··· 360 367 nr_node_put(nr_node); 361 368 } 362 369 nr_node_unlock(nr_node); 370 + spin_unlock_bh(&nr_node_list_lock); 363 371 364 372 return 0; 365 373 } 366 374 } 367 375 nr_neigh_put(nr_neigh); 368 376 nr_node_unlock(nr_node); 377 + spin_unlock_bh(&nr_node_list_lock); 369 378 nr_node_put(nr_node); 370 379 371 380 return -EINVAL;
+1 -2
net/packet/af_packet.c
··· 2522 2522 ts = __packet_set_timestamp(po, ph, skb); 2523 2523 __packet_set_status(po, ph, TP_STATUS_AVAILABLE | ts); 2524 2524 2525 - if (!packet_read_pending(&po->tx_ring)) 2526 - complete(&po->skb_completion); 2525 + complete(&po->skb_completion); 2527 2526 } 2528 2527 2529 2528 sock_wfree(skb);
+27
net/qrtr/ns.c
··· 725 725 if (ret < 0) 726 726 goto err_wq; 727 727 728 + /* As the qrtr ns socket owner and creator is the same module, we have 729 + * to decrease the qrtr module reference count to guarantee that it 730 + * remains zero after the ns socket is created, otherwise, executing 731 + * "rmmod" command is unable to make the qrtr module deleted after the 732 + * qrtr module is inserted successfully. 733 + * 734 + * However, the reference count is increased twice in 735 + * sock_create_kern(): one is to increase the reference count of owner 736 + * of qrtr socket's proto_ops struct; another is to increment the 737 + * reference count of owner of qrtr proto struct. Therefore, we must 738 + * decrement the module reference count twice to ensure that it keeps 739 + * zero after server's listening socket is created. Of course, we 740 + * must bump the module reference count twice as well before the socket 741 + * is closed. 742 + */ 743 + module_put(qrtr_ns.sock->ops->owner); 744 + module_put(qrtr_ns.sock->sk->sk_prot_creator->owner); 745 + 728 746 return 0; 729 747 730 748 err_wq: ··· 757 739 { 758 740 cancel_work_sync(&qrtr_ns.work); 759 741 destroy_workqueue(qrtr_ns.workqueue); 742 + 743 + /* sock_release() expects the two references that were put during 744 + * qrtr_ns_init(). This function is only called during module remove, 745 + * so try_stop_module() has already set the refcnt to 0. Use 746 + * __module_get() instead of try_module_get() to successfully take two 747 + * references. 748 + */ 749 + __module_get(qrtr_ns.sock->ops->owner); 750 + __module_get(qrtr_ns.sock->sk->sk_prot_creator->owner); 760 751 sock_release(qrtr_ns.sock); 761 752 } 762 753 EXPORT_SYMBOL_GPL(qrtr_ns_remove);
+1 -1
tools/lib/bpf/bpf.c
··· 105 105 */ 106 106 int probe_memcg_account(int token_fd) 107 107 { 108 - const size_t attr_sz = offsetofend(union bpf_attr, attach_btf_obj_fd); 108 + const size_t attr_sz = offsetofend(union bpf_attr, prog_token_fd); 109 109 struct bpf_insn insns[] = { 110 110 BPF_EMIT_CALL(BPF_FUNC_ktime_get_coarse_ns), 111 111 BPF_EXIT_INSN(),
+1 -1
tools/lib/bpf/features.c
··· 22 22 23 23 static int probe_kern_prog_name(int token_fd) 24 24 { 25 - const size_t attr_sz = offsetofend(union bpf_attr, prog_name); 25 + const size_t attr_sz = offsetofend(union bpf_attr, prog_token_fd); 26 26 struct bpf_insn insns[] = { 27 27 BPF_MOV64_IMM(BPF_REG_0, 0), 28 28 BPF_EXIT_INSN(),
+1 -1
tools/testing/selftests/bpf/prog_tests/btf_dump.c
··· 653 653 cmpstr = 654 654 "(struct file_operations){\n" 655 655 " .owner = (struct module *)0xffffffffffffffff,\n" 656 - " .llseek = (loff_t (*)(struct file *, loff_t, int))0xffffffffffffffff,"; 656 + " .fop_flags = (fop_flags_t)4294967295,"; 657 657 658 658 ASSERT_STRNEQ(str, cmpstr, strlen(cmpstr), "file_operations"); 659 659 }
+10
tools/testing/selftests/bpf/progs/map_kptr.c
··· 110 110 DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_ARRAY_OF_MAPS, hash_map, array_of_hash_maps); 111 111 DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_ARRAY_OF_MAPS, hash_malloc_map, array_of_hash_malloc_maps); 112 112 DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_ARRAY_OF_MAPS, lru_hash_map, array_of_lru_hash_maps); 113 + DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_ARRAY_OF_MAPS, pcpu_array_map, array_of_pcpu_array_maps); 114 + DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_ARRAY_OF_MAPS, pcpu_hash_map, array_of_pcpu_hash_maps); 113 115 DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_HASH_OF_MAPS, array_map, hash_of_array_maps); 114 116 DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_HASH_OF_MAPS, hash_map, hash_of_hash_maps); 115 117 DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_HASH_OF_MAPS, hash_malloc_map, hash_of_hash_malloc_maps); 116 118 DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_HASH_OF_MAPS, lru_hash_map, hash_of_lru_hash_maps); 119 + DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_HASH_OF_MAPS, pcpu_array_map, hash_of_pcpu_array_maps); 120 + DEFINE_MAP_OF_MAP(BPF_MAP_TYPE_HASH_OF_MAPS, pcpu_hash_map, hash_of_pcpu_hash_maps); 117 121 118 122 #define WRITE_ONCE(x, val) ((*(volatile typeof(x) *) &(x)) = (val)) 119 123 ··· 208 204 TEST(hash_map); 209 205 TEST(hash_malloc_map); 210 206 TEST(lru_hash_map); 207 + TEST(pcpu_array_map); 208 + TEST(pcpu_hash_map); 211 209 212 210 #undef TEST 213 211 return 0; ··· 287 281 TEST(array_of_hash_maps); 288 282 TEST(array_of_hash_malloc_maps); 289 283 TEST(array_of_lru_hash_maps); 284 + TEST(array_of_pcpu_array_maps); 285 + TEST(array_of_pcpu_hash_maps); 290 286 TEST(hash_of_array_maps); 291 287 TEST(hash_of_hash_maps); 292 288 TEST(hash_of_hash_malloc_maps); 293 289 TEST(hash_of_lru_hash_maps); 290 + TEST(hash_of_pcpu_array_maps); 291 + TEST(hash_of_pcpu_hash_maps); 294 292 295 293 #undef TEST 296 294 return 0;
+1 -1
tools/testing/selftests/bpf/progs/test_access_variable_array.c
··· 7 7 8 8 unsigned long span = 0; 9 9 10 - SEC("fentry/load_balance") 10 + SEC("fentry/sched_balance_rq") 11 11 int BPF_PROG(fentry_fentry, int this_cpu, struct rq *this_rq, 12 12 struct sched_domain *sd) 13 13 {
+3 -3
tools/testing/selftests/net/forwarding/bridge_igmp.sh
··· 478 478 RET=0 479 479 local X=("192.0.2.20" "192.0.2.30") 480 480 481 - # GMI should be 3 seconds 481 + # GMI should be 5 seconds 482 482 ip link set dev br0 type bridge mcast_query_interval 100 \ 483 483 mcast_query_response_interval 100 \ 484 - mcast_membership_interval 300 484 + mcast_membership_interval 500 485 485 486 486 v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP 487 487 ip link set dev br0 type bridge mcast_query_interval 500 \ ··· 489 489 mcast_membership_interval 1500 490 490 491 491 $MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_ALLOW2" -q 492 - sleep 3 492 + sleep 5 493 493 bridge -j -d -s mdb show dev br0 \ 494 494 | jq -e ".[].mdb[] | \ 495 495 select(.grp == \"$TEST_GROUP\" and \
+3 -3
tools/testing/selftests/net/forwarding/bridge_mld.sh
··· 478 478 RET=0 479 479 local X=("2001:db8:1::20" "2001:db8:1::30") 480 480 481 - # GMI should be 3 seconds 481 + # GMI should be 5 seconds 482 482 ip link set dev br0 type bridge mcast_query_interval 100 \ 483 483 mcast_query_response_interval 100 \ 484 - mcast_membership_interval 300 484 + mcast_membership_interval 500 485 485 486 486 mldv2exclude_prepare $h1 487 487 ip link set dev br0 type bridge mcast_query_interval 500 \ ··· 489 489 mcast_membership_interval 1500 490 490 491 491 $MZ $h1 -c 1 $MZPKT_ALLOW2 -q 492 - sleep 3 492 + sleep 5 493 493 bridge -j -d -s mdb show dev br0 \ 494 494 | jq -e ".[].mdb[] | \ 495 495 select(.grp == \"$TEST_GROUP\" and \
+18 -12
tools/testing/selftests/net/forwarding/local_termination.sh
··· 155 155 "$smac > $MACVLAN_ADDR, ethertype IPv4 (0x0800)" \ 156 156 true 157 157 158 - check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \ 159 - "$smac > $UNKNOWN_UC_ADDR1, ethertype IPv4 (0x0800)" \ 160 - false 158 + xfail_on_veth $h1 \ 159 + check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \ 160 + "$smac > $UNKNOWN_UC_ADDR1, ethertype IPv4 (0x0800)" \ 161 + false 161 162 162 163 check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address, promisc" \ 163 164 "$smac > $UNKNOWN_UC_ADDR2, ethertype IPv4 (0x0800)" \ 164 165 true 165 166 166 - check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address, allmulti" \ 167 - "$smac > $UNKNOWN_UC_ADDR3, ethertype IPv4 (0x0800)" \ 168 - false 167 + xfail_on_veth $h1 \ 168 + check_rcv $rcv_if_name \ 169 + "Unicast IPv4 to unknown MAC address, allmulti" \ 170 + "$smac > $UNKNOWN_UC_ADDR3, ethertype IPv4 (0x0800)" \ 171 + false 169 172 170 173 check_rcv $rcv_if_name "Multicast IPv4 to joined group" \ 171 174 "$smac > $JOINED_MACV4_MC_ADDR, ethertype IPv4 (0x0800)" \ 172 175 true 173 176 174 - check_rcv $rcv_if_name "Multicast IPv4 to unknown group" \ 175 - "$smac > $UNKNOWN_MACV4_MC_ADDR1, ethertype IPv4 (0x0800)" \ 176 - false 177 + xfail_on_veth $h1 \ 178 + check_rcv $rcv_if_name \ 179 + "Multicast IPv4 to unknown group" \ 180 + "$smac > $UNKNOWN_MACV4_MC_ADDR1, ethertype IPv4 (0x0800)" \ 181 + false 177 182 178 183 check_rcv $rcv_if_name "Multicast IPv4 to unknown group, promisc" \ 179 184 "$smac > $UNKNOWN_MACV4_MC_ADDR2, ethertype IPv4 (0x0800)" \ ··· 192 187 "$smac > $JOINED_MACV6_MC_ADDR, ethertype IPv6 (0x86dd)" \ 193 188 true 194 189 195 - check_rcv $rcv_if_name "Multicast IPv6 to unknown group" \ 196 - "$smac > $UNKNOWN_MACV6_MC_ADDR1, ethertype IPv6 (0x86dd)" \ 197 - false 190 + xfail_on_veth $h1 \ 191 + check_rcv $rcv_if_name "Multicast IPv6 to unknown group" \ 192 + "$smac > $UNKNOWN_MACV6_MC_ADDR1, ethertype IPv6 (0x86dd)" \ 193 + false 198 194 199 195 check_rcv $rcv_if_name "Multicast IPv6 to unknown group, promisc" \ 200 196 "$smac > $UNKNOWN_MACV6_MC_ADDR2, ethertype IPv6 (0x86dd)" \
+4 -2
tools/testing/selftests/net/lib.sh
··· 127 127 local ns="" 128 128 local ns_name="" 129 129 local ns_list="" 130 + local ns_exist= 130 131 for ns_name in "$@"; do 131 132 # Some test may setup/remove same netns multi times 132 133 if unset ${ns_name} 2> /dev/null; then 133 134 ns="${ns_name,,}-$(mktemp -u XXXXXX)" 134 135 eval readonly ${ns_name}="$ns" 136 + ns_exist=false 135 137 else 136 138 eval ns='$'${ns_name} 137 139 cleanup_ns "$ns" 138 - 140 + ns_exist=true 139 141 fi 140 142 141 143 if ! ip netns add "$ns"; then ··· 146 144 return $ksft_skip 147 145 fi 148 146 ip -n "$ns" link set lo up 149 - ns_list="$ns_list $ns" 147 + ! $ns_exist && ns_list="$ns_list $ns" 150 148 done 151 149 NS_LIST="$NS_LIST $ns_list" 152 150 }
+2 -2
tools/testing/selftests/net/xfrm_policy.sh
··· 293 293 local ns=$1 294 294 local log=$2 295 295 296 - for i in $(seq 100); do 296 + for i in $(seq 50); do 297 297 ip -net $ns xfrm policy flush 298 298 for j in $(seq 0 16 255 | sort -R); do 299 299 ip -net $ns xfrm policy add dst $j.0.0.0/24 dir out priority 10 action allow ··· 306 306 done 307 307 done 308 308 309 - for i in $(seq 100); do 309 + for i in $(seq 50); do 310 310 ip -net $ns xfrm policy flush 311 311 for j in $(seq 0 16 255 | sort -R); do 312 312 local addr=$(printf "e000:0000:%02x00::/56" $j)