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 git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

1) Unbreak zebra and other netlink apps, from Eric W Biederman.

2) Some new qmi_wwan device IDs, from Aleksander Morgado.

3) Fix info leak in DCB netlink handler of qlcnic driver, from Dan
Carpenter.

4) inet_getid() and ipv6_select_ident() do not generate monotonically
increasing ID numbers, fix from Eric Dumazet.

5) Fix memory leak in __sk_prepare_filter(), from Leon Yu.

6) Netlink leftover bytes warning message is user triggerable, rate
limit it. From Michal Schmidt.

7) Fix non-linear SKB panic in ipvs, from Peter Christensen.

8) Congestion window undo needs to be performed even if only never
retransmitted data is SACK'd, fix from Yuching Cheng.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (24 commits)
net: filter: fix possible memory leak in __sk_prepare_filter()
net: ec_bhf: Add runtime dependencies
tcp: fix cwnd undo on DSACK in F-RTO
netlink: Only check file credentials for implicit destinations
ipheth: Add support for iPad 2 and iPad 3
team: fix mtu setting
net: fix inet_getid() and ipv6_select_ident() bugs
net: qmi_wwan: interface #11 in Sierra Wireless MC73xx is not QMI
net: qmi_wwan: add additional Sierra Wireless QMI devices
bridge: Prevent insertion of FDB entry with disallowed vlan
netlink: rate-limit leftover bytes warning and print process name
bridge: notify user space after fdb update
net: qmi_wwan: add Netgear AirCard 341U
net: fix wrong mac_len calculation for vlans
batman-adv: fix NULL pointer dereferences
net/mlx4_core: Reset RoCE VF gids when guest driver goes down
emac: aggregation of v1-2 PLB errors for IER register
emac: add missing support of 10mbit in emac/rgmii
can: only rename enabled led triggers when changing the netdev name
ipvs: Fix panic due to non-linear skb
...

+276 -84
+1 -2
MAINTAINERS
··· 3153 3153 F: drivers/scsi/eata_pio.* 3154 3154 3155 3155 EBTABLES 3156 - M: Bart De Schuymer <bart.de.schuymer@pandora.be> 3157 3156 L: netfilter-devel@vger.kernel.org 3158 3157 W: http://ebtables.sourceforge.net/ 3159 - S: Maintained 3158 + S: Orphan 3160 3159 F: include/linux/netfilter_bridge/ebt_*.h 3161 3160 F: include/uapi/linux/netfilter_bridge/ebt_*.h 3162 3161 F: net/bridge/netfilter/ebt*.c
+3
drivers/net/can/led.c
··· 97 97 if (!priv) 98 98 return NOTIFY_DONE; 99 99 100 + if (!priv->tx_led_trig || !priv->rx_led_trig) 101 + return NOTIFY_DONE; 102 + 100 103 if (msg == NETDEV_CHANGENAME) { 101 104 snprintf(name, sizeof(name), "%s-tx", netdev->name); 102 105 led_trigger_rename_static(name, priv->tx_led_trig);
+1
drivers/net/ethernet/Kconfig
··· 39 39 config CX_ECAT 40 40 tristate "Beckhoff CX5020 EtherCAT master support" 41 41 depends on PCI 42 + depends on X86 || COMPILE_TEST 42 43 ---help--- 43 44 Driver for EtherCAT master module located on CCAT FPGA 44 45 that can be found on Beckhoff CX5020, and possibly other of CX
+1 -4
drivers/net/ethernet/ibm/emac/mal.c
··· 682 682 goto fail6; 683 683 684 684 /* Enable all MAL SERR interrupt sources */ 685 - if (mal->version == 2) 686 - set_mal_dcrn(mal, MAL_IER, MAL2_IER_EVENTS); 687 - else 688 - set_mal_dcrn(mal, MAL_IER, MAL1_IER_EVENTS); 685 + set_mal_dcrn(mal, MAL_IER, MAL_IER_EVENTS); 689 686 690 687 /* Enable EOB interrupt */ 691 688 mal_enable_eob_irq(mal);
+8 -12
drivers/net/ethernet/ibm/emac/mal.h
··· 95 95 96 96 97 97 #define MAL_IER 0x02 98 + /* MAL IER bits */ 98 99 #define MAL_IER_DE 0x00000010 99 100 #define MAL_IER_OTE 0x00000004 100 101 #define MAL_IER_OE 0x00000002 101 102 #define MAL_IER_PE 0x00000001 102 - /* MAL V1 IER bits */ 103 - #define MAL1_IER_NWE 0x00000008 104 - #define MAL1_IER_SOC_EVENTS MAL1_IER_NWE 105 - #define MAL1_IER_EVENTS (MAL1_IER_SOC_EVENTS | MAL_IER_DE | \ 106 - MAL_IER_OTE | MAL_IER_OE | MAL_IER_PE) 107 103 108 - /* MAL V2 IER bits */ 109 - #define MAL2_IER_PT 0x00000080 110 - #define MAL2_IER_PRE 0x00000040 111 - #define MAL2_IER_PWE 0x00000020 112 - #define MAL2_IER_SOC_EVENTS (MAL2_IER_PT | MAL2_IER_PRE | MAL2_IER_PWE) 113 - #define MAL2_IER_EVENTS (MAL2_IER_SOC_EVENTS | MAL_IER_DE | \ 114 - MAL_IER_OTE | MAL_IER_OE | MAL_IER_PE) 104 + /* PLB read/write/timeout errors */ 105 + #define MAL_IER_PTE 0x00000080 106 + #define MAL_IER_PRE 0x00000040 107 + #define MAL_IER_PWE 0x00000020 115 108 109 + #define MAL_IER_SOC_EVENTS (MAL_IER_PTE | MAL_IER_PRE | MAL_IER_PWE) 110 + #define MAL_IER_EVENTS (MAL_IER_SOC_EVENTS | MAL_IER_DE | \ 111 + MAL_IER_OTE | MAL_IER_OE | MAL_IER_PE) 116 112 117 113 #define MAL_TXCASR 0x04 118 114 #define MAL_TXCARR 0x05
+3
drivers/net/ethernet/ibm/emac/rgmii.c
··· 45 45 46 46 /* RGMIIx_SSR */ 47 47 #define RGMII_SSR_MASK(idx) (0x7 << ((idx) * 8)) 48 + #define RGMII_SSR_10(idx) (0x1 << ((idx) * 8)) 48 49 #define RGMII_SSR_100(idx) (0x2 << ((idx) * 8)) 49 50 #define RGMII_SSR_1000(idx) (0x4 << ((idx) * 8)) 50 51 ··· 140 139 ssr |= RGMII_SSR_1000(input); 141 140 else if (speed == SPEED_100) 142 141 ssr |= RGMII_SSR_100(input); 142 + else if (speed == SPEED_10) 143 + ssr |= RGMII_SSR_10(input); 143 144 144 145 out_be32(&p->ssr, ssr); 145 146
+1
drivers/net/ethernet/mellanox/mlx4/main.c
··· 2044 2044 if (!mlx4_is_slave(dev)) { 2045 2045 mlx4_init_mac_table(dev, &info->mac_table); 2046 2046 mlx4_init_vlan_table(dev, &info->vlan_table); 2047 + mlx4_init_roce_gid_table(dev, &info->gid_table); 2047 2048 info->base_qpn = mlx4_get_base_qpn(dev, port); 2048 2049 } 2049 2050
+15 -5
drivers/net/ethernet/mellanox/mlx4/mlx4.h
··· 695 695 int max; 696 696 }; 697 697 698 + #define MLX4_ROCE_GID_ENTRY_SIZE 16 699 + 700 + struct mlx4_roce_gid_entry { 701 + u8 raw[MLX4_ROCE_GID_ENTRY_SIZE]; 702 + }; 703 + 704 + struct mlx4_roce_gid_table { 705 + struct mlx4_roce_gid_entry roce_gids[MLX4_ROCE_MAX_GIDS]; 706 + struct mutex mutex; 707 + }; 708 + 698 709 #define MLX4_MAX_VLAN_NUM 128 699 710 #define MLX4_VLAN_TABLE_SIZE (MLX4_MAX_VLAN_NUM << 2) 700 711 ··· 769 758 struct device_attribute port_mtu_attr; 770 759 struct mlx4_mac_table mac_table; 771 760 struct mlx4_vlan_table vlan_table; 761 + struct mlx4_roce_gid_table gid_table; 772 762 int base_qpn; 773 763 }; 774 764 ··· 798 786 enum { 799 787 MLX4_NO_RR = 0, 800 788 MLX4_USE_RR = 1, 801 - }; 802 - 803 - struct mlx4_roce_gid_entry { 804 - u8 raw[16]; 805 789 }; 806 790 807 791 struct mlx4_priv { ··· 847 839 int fs_hash_mode; 848 840 u8 virt2phys_pkey[MLX4_MFUNC_MAX][MLX4_MAX_PORTS][MLX4_MAX_PORT_PKEYS]; 849 841 __be64 slave_node_guids[MLX4_MFUNC_MAX]; 850 - struct mlx4_roce_gid_entry roce_gids[MLX4_MAX_PORTS][MLX4_ROCE_MAX_GIDS]; 851 842 852 843 atomic_t opreq_count; 853 844 struct work_struct opreq_task; ··· 1147 1140 1148 1141 void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table); 1149 1142 void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table); 1143 + void mlx4_init_roce_gid_table(struct mlx4_dev *dev, 1144 + struct mlx4_roce_gid_table *table); 1150 1145 void __mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan); 1151 1146 int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 1152 1147 ··· 1158 1149 enum mlx4_resource resource_type, 1159 1150 u64 resource_id, int *slave); 1160 1151 void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave_id); 1152 + void mlx4_reset_roce_gids(struct mlx4_dev *dev, int slave); 1161 1153 int mlx4_init_resource_tracker(struct mlx4_dev *dev); 1162 1154 1163 1155 void mlx4_free_resource_tracker(struct mlx4_dev *dev,
+108 -7
drivers/net/ethernet/mellanox/mlx4/port.c
··· 75 75 table->total = 0; 76 76 } 77 77 78 + void mlx4_init_roce_gid_table(struct mlx4_dev *dev, 79 + struct mlx4_roce_gid_table *table) 80 + { 81 + int i; 82 + 83 + mutex_init(&table->mutex); 84 + for (i = 0; i < MLX4_ROCE_MAX_GIDS; i++) 85 + memset(table->roce_gids[i].raw, 0, MLX4_ROCE_GID_ENTRY_SIZE); 86 + } 87 + 78 88 static int validate_index(struct mlx4_dev *dev, 79 89 struct mlx4_mac_table *table, int index) 80 90 { ··· 594 584 } 595 585 EXPORT_SYMBOL_GPL(mlx4_get_base_gid_ix); 596 586 587 + static int mlx4_reset_roce_port_gids(struct mlx4_dev *dev, int slave, 588 + int port, struct mlx4_cmd_mailbox *mailbox) 589 + { 590 + struct mlx4_roce_gid_entry *gid_entry_mbox; 591 + struct mlx4_priv *priv = mlx4_priv(dev); 592 + int num_gids, base, offset; 593 + int i, err; 594 + 595 + num_gids = mlx4_get_slave_num_gids(dev, slave, port); 596 + base = mlx4_get_base_gid_ix(dev, slave, port); 597 + 598 + memset(mailbox->buf, 0, MLX4_MAILBOX_SIZE); 599 + 600 + mutex_lock(&(priv->port[port].gid_table.mutex)); 601 + /* Zero-out gids belonging to that slave in the port GID table */ 602 + for (i = 0, offset = base; i < num_gids; offset++, i++) 603 + memcpy(priv->port[port].gid_table.roce_gids[offset].raw, 604 + zgid_entry.raw, MLX4_ROCE_GID_ENTRY_SIZE); 605 + 606 + /* Now, copy roce port gids table to mailbox for passing to FW */ 607 + gid_entry_mbox = (struct mlx4_roce_gid_entry *)mailbox->buf; 608 + for (i = 0; i < MLX4_ROCE_MAX_GIDS; gid_entry_mbox++, i++) 609 + memcpy(gid_entry_mbox->raw, 610 + priv->port[port].gid_table.roce_gids[i].raw, 611 + MLX4_ROCE_GID_ENTRY_SIZE); 612 + 613 + err = mlx4_cmd(dev, mailbox->dma, 614 + ((u32)port) | (MLX4_SET_PORT_GID_TABLE << 8), 1, 615 + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, 616 + MLX4_CMD_NATIVE); 617 + mutex_unlock(&(priv->port[port].gid_table.mutex)); 618 + return err; 619 + } 620 + 621 + 622 + void mlx4_reset_roce_gids(struct mlx4_dev *dev, int slave) 623 + { 624 + struct mlx4_active_ports actv_ports; 625 + struct mlx4_cmd_mailbox *mailbox; 626 + int num_eth_ports, err; 627 + int i; 628 + 629 + if (slave < 0 || slave > dev->num_vfs) 630 + return; 631 + 632 + actv_ports = mlx4_get_active_ports(dev, slave); 633 + 634 + for (i = 0, num_eth_ports = 0; i < dev->caps.num_ports; i++) { 635 + if (test_bit(i, actv_ports.ports)) { 636 + if (dev->caps.port_type[i + 1] != MLX4_PORT_TYPE_ETH) 637 + continue; 638 + num_eth_ports++; 639 + } 640 + } 641 + 642 + if (!num_eth_ports) 643 + return; 644 + 645 + /* have ETH ports. Alloc mailbox for SET_PORT command */ 646 + mailbox = mlx4_alloc_cmd_mailbox(dev); 647 + if (IS_ERR(mailbox)) 648 + return; 649 + 650 + for (i = 0; i < dev->caps.num_ports; i++) { 651 + if (test_bit(i, actv_ports.ports)) { 652 + if (dev->caps.port_type[i + 1] != MLX4_PORT_TYPE_ETH) 653 + continue; 654 + err = mlx4_reset_roce_port_gids(dev, slave, i + 1, mailbox); 655 + if (err) 656 + mlx4_warn(dev, "Could not reset ETH port GID table for slave %d, port %d (%d)\n", 657 + slave, i + 1, err); 658 + } 659 + } 660 + 661 + mlx4_free_cmd_mailbox(dev, mailbox); 662 + return; 663 + } 664 + 597 665 static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, 598 666 u8 op_mod, struct mlx4_cmd_mailbox *inbox) 599 667 { ··· 780 692 /* 2. Check that do not have duplicates in OTHER 781 693 * entries in the port GID table 782 694 */ 695 + 696 + mutex_lock(&(priv->port[port].gid_table.mutex)); 783 697 for (i = 0; i < MLX4_ROCE_MAX_GIDS; i++) { 784 698 if (i >= base && i < base + num_gids) 785 699 continue; /* don't compare to slave's current gids */ 786 - gid_entry_tbl = &priv->roce_gids[port - 1][i]; 700 + gid_entry_tbl = &priv->port[port].gid_table.roce_gids[i]; 787 701 if (!memcmp(gid_entry_tbl->raw, zgid_entry.raw, sizeof(zgid_entry))) 788 702 continue; 789 703 gid_entry_mbox = (struct mlx4_roce_gid_entry *)(inbox->buf); ··· 799 709 mlx4_warn(dev, "requested gid entry for slave:%d " 800 710 "is a duplicate of gid at index %d\n", 801 711 slave, i); 712 + mutex_unlock(&(priv->port[port].gid_table.mutex)); 802 713 return -EINVAL; 803 714 } 804 715 } ··· 808 717 /* insert slave GIDs with memcpy, starting at slave's base index */ 809 718 gid_entry_mbox = (struct mlx4_roce_gid_entry *)(inbox->buf); 810 719 for (i = 0, offset = base; i < num_gids; gid_entry_mbox++, offset++, i++) 811 - memcpy(priv->roce_gids[port - 1][offset].raw, gid_entry_mbox->raw, 16); 720 + memcpy(priv->port[port].gid_table.roce_gids[offset].raw, 721 + gid_entry_mbox->raw, MLX4_ROCE_GID_ENTRY_SIZE); 812 722 813 723 /* Now, copy roce port gids table to current mailbox for passing to FW */ 814 724 gid_entry_mbox = (struct mlx4_roce_gid_entry *)(inbox->buf); 815 725 for (i = 0; i < MLX4_ROCE_MAX_GIDS; gid_entry_mbox++, i++) 816 - memcpy(gid_entry_mbox->raw, priv->roce_gids[port - 1][i].raw, 16); 726 + memcpy(gid_entry_mbox->raw, 727 + priv->port[port].gid_table.roce_gids[i].raw, 728 + MLX4_ROCE_GID_ENTRY_SIZE); 817 729 818 - break; 730 + err = mlx4_cmd(dev, inbox->dma, in_mod & 0xffff, op_mod, 731 + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, 732 + MLX4_CMD_NATIVE); 733 + mutex_unlock(&(priv->port[port].gid_table.mutex)); 734 + return err; 819 735 } 820 - return mlx4_cmd(dev, inbox->dma, in_mod, op_mod, 736 + 737 + return mlx4_cmd(dev, inbox->dma, in_mod & 0xffff, op_mod, 821 738 MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, 822 739 MLX4_CMD_NATIVE); 823 740 } ··· 1198 1099 num_vfs = bitmap_weight(slaves_pport.slaves, dev->num_vfs + 1) - 1; 1199 1100 1200 1101 for (i = 0; i < MLX4_ROCE_MAX_GIDS; i++) { 1201 - if (!memcmp(priv->roce_gids[port - 1][i].raw, gid, 16)) { 1102 + if (!memcmp(priv->port[port].gid_table.roce_gids[i].raw, gid, 1103 + MLX4_ROCE_GID_ENTRY_SIZE)) { 1202 1104 found_ix = i; 1203 1105 break; 1204 1106 } ··· 1287 1187 if (!mlx4_is_master(dev)) 1288 1188 return -EINVAL; 1289 1189 1290 - memcpy(gid, priv->roce_gids[port - 1][slave_id].raw, 16); 1190 + memcpy(gid, priv->port[port].gid_table.roce_gids[slave_id].raw, 1191 + MLX4_ROCE_GID_ENTRY_SIZE); 1291 1192 return 0; 1292 1193 } 1293 1194 EXPORT_SYMBOL(mlx4_get_roce_gid_from_slave);
+2 -1
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
··· 586 586 } 587 587 /* free master's vlans */ 588 588 i = dev->caps.function; 589 + mlx4_reset_roce_gids(dev, i); 589 590 mutex_lock(&priv->mfunc.master.res_tracker.slave_list[i].mutex); 590 591 rem_slave_vlans(dev, i); 591 592 mutex_unlock(&priv->mfunc.master.res_tracker.slave_list[i].mutex); ··· 4682 4681 void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave) 4683 4682 { 4684 4683 struct mlx4_priv *priv = mlx4_priv(dev); 4685 - 4684 + mlx4_reset_roce_gids(dev, slave); 4686 4685 mutex_lock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex); 4687 4686 rem_slave_vlans(dev, slave); 4688 4687 rem_slave_macs(dev, slave);
+1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
··· 1020 1020 struct qlcnic_dcb_cee *peer; 1021 1021 int i; 1022 1022 1023 + memset(info, 0, sizeof(*info)); 1023 1024 *app_count = 0; 1024 1025 1025 1026 if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state))
+6 -1
drivers/net/team/team.c
··· 1724 1724 * to traverse list in reverse under rcu_read_lock 1725 1725 */ 1726 1726 mutex_lock(&team->lock); 1727 + team->port_mtu_change_allowed = true; 1727 1728 list_for_each_entry(port, &team->port_list, list) { 1728 1729 err = dev_set_mtu(port->dev, new_mtu); 1729 1730 if (err) { ··· 1733 1732 goto unwind; 1734 1733 } 1735 1734 } 1735 + team->port_mtu_change_allowed = false; 1736 1736 mutex_unlock(&team->lock); 1737 1737 1738 1738 dev->mtu = new_mtu; ··· 1743 1741 unwind: 1744 1742 list_for_each_entry_continue_reverse(port, &team->port_list, list) 1745 1743 dev_set_mtu(port->dev, dev->mtu); 1744 + team->port_mtu_change_allowed = false; 1746 1745 mutex_unlock(&team->lock); 1747 1746 1748 1747 return err; ··· 2854 2851 break; 2855 2852 case NETDEV_PRECHANGEMTU: 2856 2853 /* Forbid to change mtu of underlaying device */ 2857 - return NOTIFY_BAD; 2854 + if (!port->team->port_mtu_change_allowed) 2855 + return NOTIFY_BAD; 2856 + break; 2858 2857 case NETDEV_PRE_TYPE_CHANGE: 2859 2858 /* Forbid to change type of underlaying device */ 2860 2859 return NOTIFY_BAD;
+10
drivers/net/usb/ipheth.c
··· 59 59 #define USB_PRODUCT_IPHONE_3GS 0x1294 60 60 #define USB_PRODUCT_IPHONE_4 0x1297 61 61 #define USB_PRODUCT_IPAD 0x129a 62 + #define USB_PRODUCT_IPAD_2 0x12a2 63 + #define USB_PRODUCT_IPAD_3 0x12a6 62 64 #define USB_PRODUCT_IPAD_MINI 0x12ab 63 65 #define USB_PRODUCT_IPHONE_4_VZW 0x129c 64 66 #define USB_PRODUCT_IPHONE_4S 0x12a0 ··· 106 104 IPHETH_USBINTF_PROTO) }, 107 105 { USB_DEVICE_AND_INTERFACE_INFO( 108 106 USB_VENDOR_APPLE, USB_PRODUCT_IPAD, 107 + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 108 + IPHETH_USBINTF_PROTO) }, 109 + { USB_DEVICE_AND_INTERFACE_INFO( 110 + USB_VENDOR_APPLE, USB_PRODUCT_IPAD_2, 111 + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 112 + IPHETH_USBINTF_PROTO) }, 113 + { USB_DEVICE_AND_INTERFACE_INFO( 114 + USB_VENDOR_APPLE, USB_PRODUCT_IPAD_3, 109 115 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 110 116 IPHETH_USBINTF_PROTO) }, 111 117 { USB_DEVICE_AND_INTERFACE_INFO(
+5 -1
drivers/net/usb/qmi_wwan.c
··· 748 748 {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */ 749 749 {QMI_FIXED_INTF(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC73xx */ 750 750 {QMI_FIXED_INTF(0x1199, 0x68c0, 10)}, /* Sierra Wireless MC73xx */ 751 - {QMI_FIXED_INTF(0x1199, 0x68c0, 11)}, /* Sierra Wireless MC73xx */ 752 751 {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */ 753 752 {QMI_FIXED_INTF(0x1199, 0x901f, 8)}, /* Sierra Wireless EM7355 */ 754 753 {QMI_FIXED_INTF(0x1199, 0x9041, 8)}, /* Sierra Wireless MC7305/MC7355 */ 755 754 {QMI_FIXED_INTF(0x1199, 0x9051, 8)}, /* Netgear AirCard 340U */ 755 + {QMI_FIXED_INTF(0x1199, 0x9053, 8)}, /* Sierra Wireless Modem */ 756 + {QMI_FIXED_INTF(0x1199, 0x9054, 8)}, /* Sierra Wireless Modem */ 757 + {QMI_FIXED_INTF(0x1199, 0x9055, 8)}, /* Netgear AirCard 341U */ 758 + {QMI_FIXED_INTF(0x1199, 0x9056, 8)}, /* Sierra Wireless Modem */ 759 + {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */ 756 760 {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ 757 761 {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */ 758 762 {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
+1 -1
drivers/net/wireless/iwlwifi/mvm/mac80211.c
··· 826 826 if (ret) 827 827 goto out_remove_mac; 828 828 829 - if (!mvm->bf_allowed_vif && 829 + if (!mvm->bf_allowed_vif && false && 830 830 vif->type == NL80211_IFTYPE_STATION && !vif->p2p && 831 831 mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BF_UPDATED){ 832 832 mvm->bf_allowed_vif = mvmvif;
+1
include/linux/if_team.h
··· 194 194 bool user_carrier_enabled; 195 195 bool queue_override_enabled; 196 196 struct list_head *qom_lists; /* array of queue override mapping lists */ 197 + bool port_mtu_change_allowed; 197 198 struct { 198 199 unsigned int count; 199 200 unsigned int interval; /* in ms */
+4 -3
include/linux/netlink.h
··· 16 16 } 17 17 18 18 enum netlink_skb_flags { 19 - NETLINK_SKB_MMAPED = 0x1, /* Packet data is mmaped */ 20 - NETLINK_SKB_TX = 0x2, /* Packet was sent by userspace */ 21 - NETLINK_SKB_DELIVERED = 0x4, /* Packet was delivered */ 19 + NETLINK_SKB_MMAPED = 0x1, /* Packet data is mmaped */ 20 + NETLINK_SKB_TX = 0x2, /* Packet was sent by userspace */ 21 + NETLINK_SKB_DELIVERED = 0x4, /* Packet was delivered */ 22 + NETLINK_SKB_DST = 0x8, /* Dst set in sendto or sendmsg */ 22 23 }; 23 24 24 25 struct netlink_skb_parms {
+1 -8
include/net/inetpeer.h
··· 177 177 /* can be called with or without local BH being disabled */ 178 178 static inline int inet_getid(struct inet_peer *p, int more) 179 179 { 180 - int old, new; 181 180 more++; 182 181 inet_peer_refcheck(p); 183 - do { 184 - old = atomic_read(&p->ip_id_count); 185 - new = old + more; 186 - if (!new) 187 - new = 1; 188 - } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old); 189 - return new; 182 + return atomic_add_return(more, &p->ip_id_count) - more; 190 183 } 191 184 192 185 #endif /* _NET_INETPEER_H */
+2 -2
lib/nlattr.c
··· 201 201 } 202 202 203 203 if (unlikely(rem > 0)) 204 - printk(KERN_WARNING "netlink: %d bytes leftover after parsing " 205 - "attributes.\n", rem); 204 + pr_warn_ratelimited("netlink: %d bytes leftover after parsing attributes in process `%s'.\n", 205 + rem, current->comm); 206 206 207 207 err = 0; 208 208 errout:
+3 -3
net/batman-adv/multicast.c
··· 415 415 hlist_for_each_entry_rcu(tmp_orig_node, 416 416 &bat_priv->mcast.want_all_ipv4_list, 417 417 mcast_want_all_ipv4_node) { 418 - if (!atomic_inc_not_zero(&orig_node->refcount)) 418 + if (!atomic_inc_not_zero(&tmp_orig_node->refcount)) 419 419 continue; 420 420 421 421 orig_node = tmp_orig_node; ··· 442 442 hlist_for_each_entry_rcu(tmp_orig_node, 443 443 &bat_priv->mcast.want_all_ipv6_list, 444 444 mcast_want_all_ipv6_node) { 445 - if (!atomic_inc_not_zero(&orig_node->refcount)) 445 + if (!atomic_inc_not_zero(&tmp_orig_node->refcount)) 446 446 continue; 447 447 448 448 orig_node = tmp_orig_node; ··· 493 493 hlist_for_each_entry_rcu(tmp_orig_node, 494 494 &bat_priv->mcast.want_all_unsnoopables_list, 495 495 mcast_want_all_unsnoopables_node) { 496 - if (!atomic_inc_not_zero(&orig_node->refcount)) 496 + if (!atomic_inc_not_zero(&tmp_orig_node->refcount)) 497 497 continue; 498 498 499 499 orig_node = tmp_orig_node;
+2 -2
net/bluetooth/l2cap_core.c
··· 7519 7519 l2cap_debugfs = debugfs_create_file("l2cap", 0444, bt_debugfs, 7520 7520 NULL, &l2cap_debugfs_fops); 7521 7521 7522 - debugfs_create_u16("l2cap_le_max_credits", 0466, bt_debugfs, 7522 + debugfs_create_u16("l2cap_le_max_credits", 0644, bt_debugfs, 7523 7523 &le_max_credits); 7524 - debugfs_create_u16("l2cap_le_default_mps", 0466, bt_debugfs, 7524 + debugfs_create_u16("l2cap_le_default_mps", 0644, bt_debugfs, 7525 7525 &le_default_mps); 7526 7526 7527 7527 bt_6lowpan_init();
+7 -1
net/bridge/br_fdb.c
··· 487 487 { 488 488 struct hlist_head *head = &br->hash[br_mac_hash(addr, vid)]; 489 489 struct net_bridge_fdb_entry *fdb; 490 + bool fdb_modified = false; 490 491 491 492 /* some users want to always flood. */ 492 493 if (hold_time(br) == 0) ··· 508 507 source->dev->name); 509 508 } else { 510 509 /* fastpath: update of existing entry */ 511 - fdb->dst = source; 510 + if (unlikely(source != fdb->dst)) { 511 + fdb->dst = source; 512 + fdb_modified = true; 513 + } 512 514 fdb->updated = jiffies; 513 515 if (unlikely(added_by_user)) 514 516 fdb->added_by_user = 1; 517 + if (unlikely(fdb_modified)) 518 + fdb_notify(br, fdb, RTM_NEWNEIGH); 515 519 } 516 520 } else { 517 521 spin_lock(&br->hash_lock);
+2 -2
net/bridge/br_input.c
··· 147 147 struct net_bridge_port *p = br_port_get_rcu(skb->dev); 148 148 u16 vid = 0; 149 149 150 - br_vlan_get_tag(skb, &vid); 151 - if (p->flags & BR_LEARNING) 150 + /* check if vlan is allowed, to avoid spoofing */ 151 + if (p->flags & BR_LEARNING && br_should_learn(p, skb, &vid)) 152 152 br_fdb_update(p->br, p, eth_hdr(skb)->h_source, vid, false); 153 153 return 0; /* process further */ 154 154 }
+7
net/bridge/br_private.h
··· 581 581 struct sk_buff *skb, u16 *vid); 582 582 bool br_allowed_egress(struct net_bridge *br, const struct net_port_vlans *v, 583 583 const struct sk_buff *skb); 584 + bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid); 584 585 struct sk_buff *br_handle_vlan(struct net_bridge *br, 585 586 const struct net_port_vlans *v, 586 587 struct sk_buff *skb); ··· 645 644 static inline bool br_allowed_egress(struct net_bridge *br, 646 645 const struct net_port_vlans *v, 647 646 const struct sk_buff *skb) 647 + { 648 + return true; 649 + } 650 + 651 + static inline bool br_should_learn(struct net_bridge_port *p, 652 + struct sk_buff *skb, u16 *vid) 648 653 { 649 654 return true; 650 655 }
+28
net/bridge/br_vlan.c
··· 241 241 return false; 242 242 } 243 243 244 + /* Called under RCU */ 245 + bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid) 246 + { 247 + struct net_bridge *br = p->br; 248 + struct net_port_vlans *v; 249 + 250 + if (!br->vlan_enabled) 251 + return true; 252 + 253 + v = rcu_dereference(p->vlan_info); 254 + if (!v) 255 + return false; 256 + 257 + br_vlan_get_tag(skb, vid); 258 + if (!*vid) { 259 + *vid = br_get_pvid(v); 260 + if (*vid == VLAN_N_VID) 261 + return false; 262 + 263 + return true; 264 + } 265 + 266 + if (test_bit(*vid, v->vlan_bitmap)) 267 + return true; 268 + 269 + return false; 270 + } 271 + 244 272 /* Must be protected by RTNL. 245 273 * Must be called with vid in range from 1 to 4094 inclusive. 246 274 */
+23 -8
net/core/dev.c
··· 2283 2283 2284 2284 __be16 skb_network_protocol(struct sk_buff *skb, int *depth) 2285 2285 { 2286 + unsigned int vlan_depth = skb->mac_len; 2286 2287 __be16 type = skb->protocol; 2287 - int vlan_depth = skb->mac_len; 2288 2288 2289 2289 /* Tunnel gso handlers can set protocol to ethernet. */ 2290 2290 if (type == htons(ETH_P_TEB)) { ··· 2297 2297 type = eth->h_proto; 2298 2298 } 2299 2299 2300 - while (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) { 2301 - struct vlan_hdr *vh; 2300 + /* if skb->protocol is 802.1Q/AD then the header should already be 2301 + * present at mac_len - VLAN_HLEN (if mac_len > 0), or at 2302 + * ETH_HLEN otherwise 2303 + */ 2304 + if (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) { 2305 + if (vlan_depth) { 2306 + if (unlikely(WARN_ON(vlan_depth < VLAN_HLEN))) 2307 + return 0; 2308 + vlan_depth -= VLAN_HLEN; 2309 + } else { 2310 + vlan_depth = ETH_HLEN; 2311 + } 2312 + do { 2313 + struct vlan_hdr *vh; 2302 2314 2303 - if (unlikely(!pskb_may_pull(skb, vlan_depth + VLAN_HLEN))) 2304 - return 0; 2315 + if (unlikely(!pskb_may_pull(skb, 2316 + vlan_depth + VLAN_HLEN))) 2317 + return 0; 2305 2318 2306 - vh = (struct vlan_hdr *)(skb->data + vlan_depth); 2307 - type = vh->h_vlan_encapsulated_proto; 2308 - vlan_depth += VLAN_HLEN; 2319 + vh = (struct vlan_hdr *)(skb->data + vlan_depth); 2320 + type = vh->h_vlan_encapsulated_proto; 2321 + vlan_depth += VLAN_HLEN; 2322 + } while (type == htons(ETH_P_8021Q) || 2323 + type == htons(ETH_P_8021AD)); 2309 2324 } 2310 2325 2311 2326 *depth = vlan_depth;
+6 -1
net/core/filter.c
··· 1559 1559 fp->jited = 0; 1560 1560 1561 1561 err = sk_chk_filter(fp->insns, fp->len); 1562 - if (err) 1562 + if (err) { 1563 + if (sk != NULL) 1564 + sk_filter_uncharge(sk, fp); 1565 + else 1566 + kfree(fp); 1563 1567 return ERR_PTR(err); 1568 + } 1564 1569 1565 1570 /* Probe if we can JIT compile the filter and if so, do 1566 1571 * the compilation of the filter.
+5 -6
net/ipv4/tcp_input.c
··· 2684 2684 bool recovered = !before(tp->snd_una, tp->high_seq); 2685 2685 2686 2686 if (tp->frto) { /* F-RTO RFC5682 sec 3.1 (sack enhanced version). */ 2687 - if (flag & FLAG_ORIG_SACK_ACKED) { 2688 - /* Step 3.b. A timeout is spurious if not all data are 2689 - * lost, i.e., never-retransmitted data are (s)acked. 2690 - */ 2691 - tcp_try_undo_loss(sk, true); 2687 + /* Step 3.b. A timeout is spurious if not all data are 2688 + * lost, i.e., never-retransmitted data are (s)acked. 2689 + */ 2690 + if (tcp_try_undo_loss(sk, flag & FLAG_ORIG_SACK_ACKED)) 2692 2691 return; 2693 - } 2692 + 2694 2693 if (after(tp->snd_nxt, tp->high_seq) && 2695 2694 (flag & FLAG_DATA_SACKED || is_dupack)) { 2696 2695 tp->frto = 0; /* Loss was real: 2nd part of step 3.a */
+3 -8
net/ipv6/output_core.c
··· 12 12 { 13 13 static atomic_t ipv6_fragmentation_id; 14 14 struct in6_addr addr; 15 - int old, new; 15 + int ident; 16 16 17 17 #if IS_ENABLED(CONFIG_IPV6) 18 18 struct inet_peer *peer; ··· 26 26 return; 27 27 } 28 28 #endif 29 - do { 30 - old = atomic_read(&ipv6_fragmentation_id); 31 - new = old + 1; 32 - if (!new) 33 - new = 1; 34 - } while (atomic_cmpxchg(&ipv6_fragmentation_id, old, new) != old); 29 + ident = atomic_inc_return(&ipv6_fragmentation_id); 35 30 36 31 addr = rt->rt6i_dst.addr; 37 - addr.s6_addr32[0] ^= (__force __be32)new; 32 + addr.s6_addr32[0] ^= (__force __be32)ident; 38 33 fhdr->identification = htonl(secure_ipv6_id(addr.s6_addr32)); 39 34 } 40 35 EXPORT_SYMBOL(ipv6_select_ident);
+10 -5
net/netfilter/ipvs/ip_vs_core.c
··· 1392 1392 1393 1393 if (ipip) { 1394 1394 __be32 info = ic->un.gateway; 1395 + __u8 type = ic->type; 1396 + __u8 code = ic->code; 1395 1397 1396 1398 /* Update the MTU */ 1397 1399 if (ic->type == ICMP_DEST_UNREACH && 1398 1400 ic->code == ICMP_FRAG_NEEDED) { 1399 1401 struct ip_vs_dest *dest = cp->dest; 1400 1402 u32 mtu = ntohs(ic->un.frag.mtu); 1403 + __be16 frag_off = cih->frag_off; 1401 1404 1402 1405 /* Strip outer IP and ICMP, go to IPIP header */ 1403 - __skb_pull(skb, ihl + sizeof(_icmph)); 1406 + if (pskb_pull(skb, ihl + sizeof(_icmph)) == NULL) 1407 + goto ignore_ipip; 1404 1408 offset2 -= ihl + sizeof(_icmph); 1405 1409 skb_reset_network_header(skb); 1406 1410 IP_VS_DBG(12, "ICMP for IPIP %pI4->%pI4: mtu=%u\n", ··· 1412 1408 ipv4_update_pmtu(skb, dev_net(skb->dev), 1413 1409 mtu, 0, 0, 0, 0); 1414 1410 /* Client uses PMTUD? */ 1415 - if (!(cih->frag_off & htons(IP_DF))) 1411 + if (!(frag_off & htons(IP_DF))) 1416 1412 goto ignore_ipip; 1417 1413 /* Prefer the resulting PMTU */ 1418 1414 if (dest) { ··· 1431 1427 /* Strip outer IP, ICMP and IPIP, go to IP header of 1432 1428 * original request. 1433 1429 */ 1434 - __skb_pull(skb, offset2); 1430 + if (pskb_pull(skb, offset2) == NULL) 1431 + goto ignore_ipip; 1435 1432 skb_reset_network_header(skb); 1436 1433 IP_VS_DBG(12, "Sending ICMP for %pI4->%pI4: t=%u, c=%u, i=%u\n", 1437 1434 &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr, 1438 - ic->type, ic->code, ntohl(info)); 1439 - icmp_send(skb, ic->type, ic->code, info); 1435 + type, code, ntohl(info)); 1436 + icmp_send(skb, type, code, info); 1440 1437 /* ICMP can be shorter but anyways, account it */ 1441 1438 ip_vs_out_stats(cp, skb); 1442 1439
+6 -1
net/netlink/af_netlink.c
··· 1373 1373 bool __netlink_ns_capable(const struct netlink_skb_parms *nsp, 1374 1374 struct user_namespace *user_ns, int cap) 1375 1375 { 1376 - return sk_ns_capable(nsp->sk, user_ns, cap); 1376 + return ((nsp->flags & NETLINK_SKB_DST) || 1377 + file_ns_capable(nsp->sk->sk_socket->file, user_ns, cap)) && 1378 + ns_capable(user_ns, cap); 1377 1379 } 1378 1380 EXPORT_SYMBOL(__netlink_ns_capable); 1379 1381 ··· 2295 2293 struct sk_buff *skb; 2296 2294 int err; 2297 2295 struct scm_cookie scm; 2296 + u32 netlink_skb_flags = 0; 2298 2297 2299 2298 if (msg->msg_flags&MSG_OOB) 2300 2299 return -EOPNOTSUPP; ··· 2317 2314 if ((dst_group || dst_portid) && 2318 2315 !netlink_allowed(sock, NL_CFG_F_NONROOT_SEND)) 2319 2316 goto out; 2317 + netlink_skb_flags |= NETLINK_SKB_DST; 2320 2318 } else { 2321 2319 dst_portid = nlk->dst_portid; 2322 2320 dst_group = nlk->dst_group; ··· 2347 2343 NETLINK_CB(skb).portid = nlk->portid; 2348 2344 NETLINK_CB(skb).dst_group = dst_group; 2349 2345 NETLINK_CB(skb).creds = siocb->scm->creds; 2346 + NETLINK_CB(skb).flags = netlink_skb_flags; 2350 2347 2351 2348 err = -EFAULT; 2352 2349 if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {