diff options
| -rw-r--r-- | drivers/net/ethernet/amd/pcnet32.c | 31 | ||||
| -rw-r--r-- | drivers/net/ethernet/emulex/benet/be.h | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 17 | ||||
| -rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.h | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 131 | ||||
| -rw-r--r-- | drivers/net/usb/cx82310_eth.c | 30 | ||||
| -rw-r--r-- | include/net/netfilter/nf_log.h | 10 | ||||
| -rw-r--r-- | net/compat.c | 7 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 6 | ||||
| -rw-r--r-- | net/ipv4/tcp_output.c | 6 | ||||
| -rw-r--r-- | net/ipv6/fib6_rules.c | 1 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 6 | ||||
| -rw-r--r-- | net/ipv6/udp_offload.c | 8 | ||||
| -rw-r--r-- | net/netfilter/nf_log.c | 24 | ||||
| -rw-r--r-- | net/netfilter/nf_tables_api.c | 5 | ||||
| -rw-r--r-- | net/netfilter/nf_tables_core.c | 8 | ||||
| -rw-r--r-- | net/netfilter/nfnetlink_cthelper.c | 3 | ||||
| -rw-r--r-- | net/netfilter/nft_compat.c | 6 | ||||
| -rw-r--r-- | net/netfilter/nft_hash.c | 2 | ||||
| -rw-r--r-- | net/netfilter/xt_TPROXY.c | 4 | ||||
| -rw-r--r-- | net/socket.c | 4 |
21 files changed, 238 insertions, 75 deletions
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c index 11d6e6561df1..15a8190a6f75 100644 --- a/drivers/net/ethernet/amd/pcnet32.c +++ b/drivers/net/ethernet/amd/pcnet32.c | |||
| @@ -1543,7 +1543,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
| 1543 | { | 1543 | { |
| 1544 | struct pcnet32_private *lp; | 1544 | struct pcnet32_private *lp; |
| 1545 | int i, media; | 1545 | int i, media; |
| 1546 | int fdx, mii, fset, dxsuflo; | 1546 | int fdx, mii, fset, dxsuflo, sram; |
| 1547 | int chip_version; | 1547 | int chip_version; |
| 1548 | char *chipname; | 1548 | char *chipname; |
| 1549 | struct net_device *dev; | 1549 | struct net_device *dev; |
| @@ -1580,7 +1580,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
| 1580 | } | 1580 | } |
| 1581 | 1581 | ||
| 1582 | /* initialize variables */ | 1582 | /* initialize variables */ |
| 1583 | fdx = mii = fset = dxsuflo = 0; | 1583 | fdx = mii = fset = dxsuflo = sram = 0; |
| 1584 | chip_version = (chip_version >> 12) & 0xffff; | 1584 | chip_version = (chip_version >> 12) & 0xffff; |
| 1585 | 1585 | ||
| 1586 | switch (chip_version) { | 1586 | switch (chip_version) { |
| @@ -1613,6 +1613,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
| 1613 | chipname = "PCnet/FAST III 79C973"; /* PCI */ | 1613 | chipname = "PCnet/FAST III 79C973"; /* PCI */ |
| 1614 | fdx = 1; | 1614 | fdx = 1; |
| 1615 | mii = 1; | 1615 | mii = 1; |
| 1616 | sram = 1; | ||
| 1616 | break; | 1617 | break; |
| 1617 | case 0x2626: | 1618 | case 0x2626: |
| 1618 | chipname = "PCnet/Home 79C978"; /* PCI */ | 1619 | chipname = "PCnet/Home 79C978"; /* PCI */ |
| @@ -1636,6 +1637,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
| 1636 | chipname = "PCnet/FAST III 79C975"; /* PCI */ | 1637 | chipname = "PCnet/FAST III 79C975"; /* PCI */ |
| 1637 | fdx = 1; | 1638 | fdx = 1; |
| 1638 | mii = 1; | 1639 | mii = 1; |
| 1640 | sram = 1; | ||
| 1639 | break; | 1641 | break; |
| 1640 | case 0x2628: | 1642 | case 0x2628: |
| 1641 | chipname = "PCnet/PRO 79C976"; | 1643 | chipname = "PCnet/PRO 79C976"; |
| @@ -1664,6 +1666,31 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
| 1664 | dxsuflo = 1; | 1666 | dxsuflo = 1; |
| 1665 | } | 1667 | } |
| 1666 | 1668 | ||
| 1669 | /* | ||
| 1670 | * The Am79C973/Am79C975 controllers come with 12K of SRAM | ||
| 1671 | * which we can use for the Tx/Rx buffers but most importantly, | ||
| 1672 | * the use of SRAM allow us to use the BCR18:NOUFLO bit to avoid | ||
| 1673 | * Tx fifo underflows. | ||
| 1674 | */ | ||
| 1675 | if (sram) { | ||
| 1676 | /* | ||
| 1677 | * The SRAM is being configured in two steps. First we | ||
| 1678 | * set the SRAM size in the BCR25:SRAM_SIZE bits. According | ||
| 1679 | * to the datasheet, each bit corresponds to a 512-byte | ||
| 1680 | * page so we can have at most 24 pages. The SRAM_SIZE | ||
| 1681 | * holds the value of the upper 8 bits of the 16-bit SRAM size. | ||
| 1682 | * The low 8-bits start at 0x00 and end at 0xff. So the | ||
| 1683 | * address range is from 0x0000 up to 0x17ff. Therefore, | ||
| 1684 | * the SRAM_SIZE is set to 0x17. The next step is to set | ||
| 1685 | * the BCR26:SRAM_BND midway through so the Tx and Rx | ||
| 1686 | * buffers can share the SRAM equally. | ||
| 1687 | */ | ||
| 1688 | a->write_bcr(ioaddr, 25, 0x17); | ||
| 1689 | a->write_bcr(ioaddr, 26, 0xc); | ||
| 1690 | /* And finally enable the NOUFLO bit */ | ||
| 1691 | a->write_bcr(ioaddr, 18, a->read_bcr(ioaddr, 18) | (1 << 11)); | ||
| 1692 | } | ||
| 1693 | |||
| 1667 | dev = alloc_etherdev(sizeof(*lp)); | 1694 | dev = alloc_etherdev(sizeof(*lp)); |
| 1668 | if (!dev) { | 1695 | if (!dev) { |
| 1669 | ret = -ENOMEM; | 1696 | ret = -ENOMEM; |
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 27de37aa90af..27b9fe99a9bd 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
| @@ -354,6 +354,7 @@ struct be_vf_cfg { | |||
| 354 | u16 vlan_tag; | 354 | u16 vlan_tag; |
| 355 | u32 tx_rate; | 355 | u32 tx_rate; |
| 356 | u32 plink_tracking; | 356 | u32 plink_tracking; |
| 357 | u32 privileges; | ||
| 357 | }; | 358 | }; |
| 358 | 359 | ||
| 359 | enum vf_state { | 360 | enum vf_state { |
| @@ -423,6 +424,7 @@ struct be_adapter { | |||
| 423 | 424 | ||
| 424 | u8 __iomem *csr; /* CSR BAR used only for BE2/3 */ | 425 | u8 __iomem *csr; /* CSR BAR used only for BE2/3 */ |
| 425 | u8 __iomem *db; /* Door Bell */ | 426 | u8 __iomem *db; /* Door Bell */ |
| 427 | u8 __iomem *pcicfg; /* On SH,BEx only. Shadow of PCI config space */ | ||
| 426 | 428 | ||
| 427 | struct mutex mbox_lock; /* For serializing mbox cmds to BE card */ | 429 | struct mutex mbox_lock; /* For serializing mbox cmds to BE card */ |
| 428 | struct be_dma_mem mbox_mem; | 430 | struct be_dma_mem mbox_mem; |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index 36916cfa70f9..7f05f309e935 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
| @@ -1902,15 +1902,11 @@ int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd, | |||
| 1902 | { | 1902 | { |
| 1903 | int num_eqs, i = 0; | 1903 | int num_eqs, i = 0; |
| 1904 | 1904 | ||
| 1905 | if (lancer_chip(adapter) && num > 8) { | 1905 | while (num) { |
| 1906 | while (num) { | 1906 | num_eqs = min(num, 8); |
| 1907 | num_eqs = min(num, 8); | 1907 | __be_cmd_modify_eqd(adapter, &set_eqd[i], num_eqs); |
| 1908 | __be_cmd_modify_eqd(adapter, &set_eqd[i], num_eqs); | 1908 | i += num_eqs; |
| 1909 | i += num_eqs; | 1909 | num -= num_eqs; |
| 1910 | num -= num_eqs; | ||
| 1911 | } | ||
| 1912 | } else { | ||
| 1913 | __be_cmd_modify_eqd(adapter, set_eqd, num); | ||
| 1914 | } | 1910 | } |
| 1915 | 1911 | ||
| 1916 | return 0; | 1912 | return 0; |
| @@ -1918,7 +1914,7 @@ int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd, | |||
| 1918 | 1914 | ||
| 1919 | /* Uses sycnhronous mcc */ | 1915 | /* Uses sycnhronous mcc */ |
| 1920 | int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array, | 1916 | int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array, |
| 1921 | u32 num) | 1917 | u32 num, u32 domain) |
| 1922 | { | 1918 | { |
| 1923 | struct be_mcc_wrb *wrb; | 1919 | struct be_mcc_wrb *wrb; |
| 1924 | struct be_cmd_req_vlan_config *req; | 1920 | struct be_cmd_req_vlan_config *req; |
| @@ -1936,6 +1932,7 @@ int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array, | |||
| 1936 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | 1932 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, |
| 1937 | OPCODE_COMMON_NTWK_VLAN_CONFIG, sizeof(*req), | 1933 | OPCODE_COMMON_NTWK_VLAN_CONFIG, sizeof(*req), |
| 1938 | wrb, NULL); | 1934 | wrb, NULL); |
| 1935 | req->hdr.domain = domain; | ||
| 1939 | 1936 | ||
| 1940 | req->interface_id = if_id; | 1937 | req->interface_id = if_id; |
| 1941 | req->untagged = BE_IF_FLAGS_UNTAGGED & be_if_cap_flags(adapter) ? 1 : 0; | 1938 | req->untagged = BE_IF_FLAGS_UNTAGGED & be_if_cap_flags(adapter) ? 1 : 0; |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h index db761e8e42a3..a7634a3f052a 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.h +++ b/drivers/net/ethernet/emulex/benet/be_cmds.h | |||
| @@ -2256,7 +2256,7 @@ int lancer_cmd_get_pport_stats(struct be_adapter *adapter, | |||
| 2256 | int be_cmd_get_fw_ver(struct be_adapter *adapter); | 2256 | int be_cmd_get_fw_ver(struct be_adapter *adapter); |
| 2257 | int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *, int num); | 2257 | int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *, int num); |
| 2258 | int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array, | 2258 | int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array, |
| 2259 | u32 num); | 2259 | u32 num, u32 domain); |
| 2260 | int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 status); | 2260 | int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 status); |
| 2261 | int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc); | 2261 | int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc); |
| 2262 | int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc); | 2262 | int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc); |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 0a816859aca5..e6b790f0d9dc 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
| @@ -1171,7 +1171,7 @@ static int be_vid_config(struct be_adapter *adapter) | |||
| 1171 | for_each_set_bit(i, adapter->vids, VLAN_N_VID) | 1171 | for_each_set_bit(i, adapter->vids, VLAN_N_VID) |
| 1172 | vids[num++] = cpu_to_le16(i); | 1172 | vids[num++] = cpu_to_le16(i); |
| 1173 | 1173 | ||
| 1174 | status = be_cmd_vlan_config(adapter, adapter->if_handle, vids, num); | 1174 | status = be_cmd_vlan_config(adapter, adapter->if_handle, vids, num, 0); |
| 1175 | if (status) { | 1175 | if (status) { |
| 1176 | dev_err(dev, "Setting HW VLAN filtering failed\n"); | 1176 | dev_err(dev, "Setting HW VLAN filtering failed\n"); |
| 1177 | /* Set to VLAN promisc mode as setting VLAN filter failed */ | 1177 | /* Set to VLAN promisc mode as setting VLAN filter failed */ |
| @@ -1380,11 +1380,67 @@ static int be_get_vf_config(struct net_device *netdev, int vf, | |||
| 1380 | return 0; | 1380 | return 0; |
| 1381 | } | 1381 | } |
| 1382 | 1382 | ||
| 1383 | static int be_set_vf_tvt(struct be_adapter *adapter, int vf, u16 vlan) | ||
| 1384 | { | ||
| 1385 | struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf]; | ||
| 1386 | u16 vids[BE_NUM_VLANS_SUPPORTED]; | ||
| 1387 | int vf_if_id = vf_cfg->if_handle; | ||
| 1388 | int status; | ||
| 1389 | |||
| 1390 | /* Enable Transparent VLAN Tagging */ | ||
| 1391 | status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, vf_if_id, 0); | ||
| 1392 | if (status) | ||
| 1393 | return status; | ||
| 1394 | |||
| 1395 | /* Clear pre-programmed VLAN filters on VF if any, if TVT is enabled */ | ||
| 1396 | vids[0] = 0; | ||
| 1397 | status = be_cmd_vlan_config(adapter, vf_if_id, vids, 1, vf + 1); | ||
| 1398 | if (!status) | ||
| 1399 | dev_info(&adapter->pdev->dev, | ||
| 1400 | "Cleared guest VLANs on VF%d", vf); | ||
| 1401 | |||
| 1402 | /* After TVT is enabled, disallow VFs to program VLAN filters */ | ||
| 1403 | if (vf_cfg->privileges & BE_PRIV_FILTMGMT) { | ||
| 1404 | status = be_cmd_set_fn_privileges(adapter, vf_cfg->privileges & | ||
| 1405 | ~BE_PRIV_FILTMGMT, vf + 1); | ||
| 1406 | if (!status) | ||
| 1407 | vf_cfg->privileges &= ~BE_PRIV_FILTMGMT; | ||
| 1408 | } | ||
| 1409 | return 0; | ||
| 1410 | } | ||
| 1411 | |||
| 1412 | static int be_clear_vf_tvt(struct be_adapter *adapter, int vf) | ||
| 1413 | { | ||
| 1414 | struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf]; | ||
| 1415 | struct device *dev = &adapter->pdev->dev; | ||
| 1416 | int status; | ||
| 1417 | |||
| 1418 | /* Reset Transparent VLAN Tagging. */ | ||
| 1419 | status = be_cmd_set_hsw_config(adapter, BE_RESET_VLAN_TAG_ID, vf + 1, | ||
| 1420 | vf_cfg->if_handle, 0); | ||
| 1421 | if (status) | ||
| 1422 | return status; | ||
| 1423 | |||
| 1424 | /* Allow VFs to program VLAN filtering */ | ||
| 1425 | if (!(vf_cfg->privileges & BE_PRIV_FILTMGMT)) { | ||
| 1426 | status = be_cmd_set_fn_privileges(adapter, vf_cfg->privileges | | ||
| 1427 | BE_PRIV_FILTMGMT, vf + 1); | ||
| 1428 | if (!status) { | ||
| 1429 | vf_cfg->privileges |= BE_PRIV_FILTMGMT; | ||
| 1430 | dev_info(dev, "VF%d: FILTMGMT priv enabled", vf); | ||
| 1431 | } | ||
| 1432 | } | ||
| 1433 | |||
| 1434 | dev_info(dev, | ||
| 1435 | "Disable/re-enable i/f in VM to clear Transparent VLAN tag"); | ||
| 1436 | return 0; | ||
| 1437 | } | ||
| 1438 | |||
| 1383 | static int be_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos) | 1439 | static int be_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos) |
| 1384 | { | 1440 | { |
| 1385 | struct be_adapter *adapter = netdev_priv(netdev); | 1441 | struct be_adapter *adapter = netdev_priv(netdev); |
| 1386 | struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf]; | 1442 | struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf]; |
| 1387 | int status = 0; | 1443 | int status; |
| 1388 | 1444 | ||
| 1389 | if (!sriov_enabled(adapter)) | 1445 | if (!sriov_enabled(adapter)) |
| 1390 | return -EPERM; | 1446 | return -EPERM; |
| @@ -1394,24 +1450,19 @@ static int be_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos) | |||
| 1394 | 1450 | ||
| 1395 | if (vlan || qos) { | 1451 | if (vlan || qos) { |
| 1396 | vlan |= qos << VLAN_PRIO_SHIFT; | 1452 | vlan |= qos << VLAN_PRIO_SHIFT; |
| 1397 | if (vf_cfg->vlan_tag != vlan) | 1453 | status = be_set_vf_tvt(adapter, vf, vlan); |
| 1398 | status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, | ||
| 1399 | vf_cfg->if_handle, 0); | ||
| 1400 | } else { | 1454 | } else { |
| 1401 | /* Reset Transparent Vlan Tagging. */ | 1455 | status = be_clear_vf_tvt(adapter, vf); |
| 1402 | status = be_cmd_set_hsw_config(adapter, BE_RESET_VLAN_TAG_ID, | ||
| 1403 | vf + 1, vf_cfg->if_handle, 0); | ||
| 1404 | } | 1456 | } |
| 1405 | 1457 | ||
| 1406 | if (status) { | 1458 | if (status) { |
| 1407 | dev_err(&adapter->pdev->dev, | 1459 | dev_err(&adapter->pdev->dev, |
| 1408 | "VLAN %d config on VF %d failed : %#x\n", vlan, | 1460 | "VLAN %d config on VF %d failed : %#x\n", vlan, vf, |
| 1409 | vf, status); | 1461 | status); |
| 1410 | return be_cmd_status(status); | 1462 | return be_cmd_status(status); |
| 1411 | } | 1463 | } |
| 1412 | 1464 | ||
| 1413 | vf_cfg->vlan_tag = vlan; | 1465 | vf_cfg->vlan_tag = vlan; |
| 1414 | |||
| 1415 | return 0; | 1466 | return 0; |
| 1416 | } | 1467 | } |
| 1417 | 1468 | ||
| @@ -2772,14 +2823,12 @@ void be_detect_error(struct be_adapter *adapter) | |||
| 2772 | } | 2823 | } |
| 2773 | } | 2824 | } |
| 2774 | } else { | 2825 | } else { |
| 2775 | pci_read_config_dword(adapter->pdev, | 2826 | ue_lo = ioread32(adapter->pcicfg + PCICFG_UE_STATUS_LOW); |
| 2776 | PCICFG_UE_STATUS_LOW, &ue_lo); | 2827 | ue_hi = ioread32(adapter->pcicfg + PCICFG_UE_STATUS_HIGH); |
| 2777 | pci_read_config_dword(adapter->pdev, | 2828 | ue_lo_mask = ioread32(adapter->pcicfg + |
| 2778 | PCICFG_UE_STATUS_HIGH, &ue_hi); | 2829 | PCICFG_UE_STATUS_LOW_MASK); |
| 2779 | pci_read_config_dword(adapter->pdev, | 2830 | ue_hi_mask = ioread32(adapter->pcicfg + |
| 2780 | PCICFG_UE_STATUS_LOW_MASK, &ue_lo_mask); | 2831 | PCICFG_UE_STATUS_HI_MASK); |
| 2781 | pci_read_config_dword(adapter->pdev, | ||
| 2782 | PCICFG_UE_STATUS_HI_MASK, &ue_hi_mask); | ||
| 2783 | 2832 | ||
| 2784 | ue_lo = (ue_lo & ~ue_lo_mask); | 2833 | ue_lo = (ue_lo & ~ue_lo_mask); |
| 2785 | ue_hi = (ue_hi & ~ue_hi_mask); | 2834 | ue_hi = (ue_hi & ~ue_hi_mask); |
| @@ -3339,7 +3388,6 @@ static int be_if_create(struct be_adapter *adapter, u32 *if_handle, | |||
| 3339 | u32 cap_flags, u32 vf) | 3388 | u32 cap_flags, u32 vf) |
| 3340 | { | 3389 | { |
| 3341 | u32 en_flags; | 3390 | u32 en_flags; |
| 3342 | int status; | ||
| 3343 | 3391 | ||
| 3344 | en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | | 3392 | en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | |
| 3345 | BE_IF_FLAGS_MULTICAST | BE_IF_FLAGS_PASS_L3L4_ERRORS | | 3393 | BE_IF_FLAGS_MULTICAST | BE_IF_FLAGS_PASS_L3L4_ERRORS | |
| @@ -3347,10 +3395,7 @@ static int be_if_create(struct be_adapter *adapter, u32 *if_handle, | |||
| 3347 | 3395 | ||
| 3348 | en_flags &= cap_flags; | 3396 | en_flags &= cap_flags; |
| 3349 | 3397 | ||
| 3350 | status = be_cmd_if_create(adapter, cap_flags, en_flags, | 3398 | return be_cmd_if_create(adapter, cap_flags, en_flags, if_handle, vf); |
| 3351 | if_handle, vf); | ||
| 3352 | |||
| 3353 | return status; | ||
| 3354 | } | 3399 | } |
| 3355 | 3400 | ||
| 3356 | static int be_vfs_if_create(struct be_adapter *adapter) | 3401 | static int be_vfs_if_create(struct be_adapter *adapter) |
| @@ -3368,8 +3413,13 @@ static int be_vfs_if_create(struct be_adapter *adapter) | |||
| 3368 | if (!BE3_chip(adapter)) { | 3413 | if (!BE3_chip(adapter)) { |
| 3369 | status = be_cmd_get_profile_config(adapter, &res, | 3414 | status = be_cmd_get_profile_config(adapter, &res, |
| 3370 | vf + 1); | 3415 | vf + 1); |
| 3371 | if (!status) | 3416 | if (!status) { |
| 3372 | cap_flags = res.if_cap_flags; | 3417 | cap_flags = res.if_cap_flags; |
| 3418 | /* Prevent VFs from enabling VLAN promiscuous | ||
| 3419 | * mode | ||
| 3420 | */ | ||
| 3421 | cap_flags &= ~BE_IF_FLAGS_VLAN_PROMISCUOUS; | ||
| 3422 | } | ||
| 3373 | } | 3423 | } |
| 3374 | 3424 | ||
| 3375 | status = be_if_create(adapter, &vf_cfg->if_handle, | 3425 | status = be_if_create(adapter, &vf_cfg->if_handle, |
| @@ -3403,7 +3453,6 @@ static int be_vf_setup(struct be_adapter *adapter) | |||
| 3403 | struct device *dev = &adapter->pdev->dev; | 3453 | struct device *dev = &adapter->pdev->dev; |
| 3404 | struct be_vf_cfg *vf_cfg; | 3454 | struct be_vf_cfg *vf_cfg; |
| 3405 | int status, old_vfs, vf; | 3455 | int status, old_vfs, vf; |
| 3406 | u32 privileges; | ||
| 3407 | 3456 | ||
| 3408 | old_vfs = pci_num_vf(adapter->pdev); | 3457 | old_vfs = pci_num_vf(adapter->pdev); |
| 3409 | 3458 | ||
| @@ -3433,15 +3482,18 @@ static int be_vf_setup(struct be_adapter *adapter) | |||
| 3433 | 3482 | ||
| 3434 | for_all_vfs(adapter, vf_cfg, vf) { | 3483 | for_all_vfs(adapter, vf_cfg, vf) { |
| 3435 | /* Allow VFs to programs MAC/VLAN filters */ | 3484 | /* Allow VFs to programs MAC/VLAN filters */ |
| 3436 | status = be_cmd_get_fn_privileges(adapter, &privileges, vf + 1); | 3485 | status = be_cmd_get_fn_privileges(adapter, &vf_cfg->privileges, |
| 3437 | if (!status && !(privileges & BE_PRIV_FILTMGMT)) { | 3486 | vf + 1); |
| 3487 | if (!status && !(vf_cfg->privileges & BE_PRIV_FILTMGMT)) { | ||
| 3438 | status = be_cmd_set_fn_privileges(adapter, | 3488 | status = be_cmd_set_fn_privileges(adapter, |
| 3439 | privileges | | 3489 | vf_cfg->privileges | |
| 3440 | BE_PRIV_FILTMGMT, | 3490 | BE_PRIV_FILTMGMT, |
| 3441 | vf + 1); | 3491 | vf + 1); |
| 3442 | if (!status) | 3492 | if (!status) { |
| 3493 | vf_cfg->privileges |= BE_PRIV_FILTMGMT; | ||
| 3443 | dev_info(dev, "VF%d has FILTMGMT privilege\n", | 3494 | dev_info(dev, "VF%d has FILTMGMT privilege\n", |
| 3444 | vf); | 3495 | vf); |
| 3496 | } | ||
| 3445 | } | 3497 | } |
| 3446 | 3498 | ||
| 3447 | /* Allow full available bandwidth */ | 3499 | /* Allow full available bandwidth */ |
| @@ -4820,24 +4872,37 @@ static int be_roce_map_pci_bars(struct be_adapter *adapter) | |||
| 4820 | 4872 | ||
| 4821 | static int be_map_pci_bars(struct be_adapter *adapter) | 4873 | static int be_map_pci_bars(struct be_adapter *adapter) |
| 4822 | { | 4874 | { |
| 4875 | struct pci_dev *pdev = adapter->pdev; | ||
| 4823 | u8 __iomem *addr; | 4876 | u8 __iomem *addr; |
| 4824 | 4877 | ||
| 4825 | if (BEx_chip(adapter) && be_physfn(adapter)) { | 4878 | if (BEx_chip(adapter) && be_physfn(adapter)) { |
| 4826 | adapter->csr = pci_iomap(adapter->pdev, 2, 0); | 4879 | adapter->csr = pci_iomap(pdev, 2, 0); |
| 4827 | if (!adapter->csr) | 4880 | if (!adapter->csr) |
| 4828 | return -ENOMEM; | 4881 | return -ENOMEM; |
| 4829 | } | 4882 | } |
| 4830 | 4883 | ||
| 4831 | addr = pci_iomap(adapter->pdev, db_bar(adapter), 0); | 4884 | addr = pci_iomap(pdev, db_bar(adapter), 0); |
| 4832 | if (!addr) | 4885 | if (!addr) |
| 4833 | goto pci_map_err; | 4886 | goto pci_map_err; |
| 4834 | adapter->db = addr; | 4887 | adapter->db = addr; |
| 4835 | 4888 | ||
| 4889 | if (skyhawk_chip(adapter) || BEx_chip(adapter)) { | ||
| 4890 | if (be_physfn(adapter)) { | ||
| 4891 | /* PCICFG is the 2nd BAR in BE2 */ | ||
| 4892 | addr = pci_iomap(pdev, BE2_chip(adapter) ? 1 : 0, 0); | ||
| 4893 | if (!addr) | ||
| 4894 | goto pci_map_err; | ||
| 4895 | adapter->pcicfg = addr; | ||
| 4896 | } else { | ||
| 4897 | adapter->pcicfg = adapter->db + SRIOV_VF_PCICFG_OFFSET; | ||
| 4898 | } | ||
| 4899 | } | ||
| 4900 | |||
| 4836 | be_roce_map_pci_bars(adapter); | 4901 | be_roce_map_pci_bars(adapter); |
| 4837 | return 0; | 4902 | return 0; |
| 4838 | 4903 | ||
| 4839 | pci_map_err: | 4904 | pci_map_err: |
| 4840 | dev_err(&adapter->pdev->dev, "Error in mapping PCI BARs\n"); | 4905 | dev_err(&pdev->dev, "Error in mapping PCI BARs\n"); |
| 4841 | be_unmap_pci_bars(adapter); | 4906 | be_unmap_pci_bars(adapter); |
| 4842 | return -ENOMEM; | 4907 | return -ENOMEM; |
| 4843 | } | 4908 | } |
diff --git a/drivers/net/usb/cx82310_eth.c b/drivers/net/usb/cx82310_eth.c index fe48f4c51373..1762ad3910b2 100644 --- a/drivers/net/usb/cx82310_eth.c +++ b/drivers/net/usb/cx82310_eth.c | |||
| @@ -46,8 +46,7 @@ enum cx82310_status { | |||
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | #define CMD_PACKET_SIZE 64 | 48 | #define CMD_PACKET_SIZE 64 |
| 49 | /* first command after power on can take around 8 seconds */ | 49 | #define CMD_TIMEOUT 100 |
| 50 | #define CMD_TIMEOUT 15000 | ||
| 51 | #define CMD_REPLY_RETRY 5 | 50 | #define CMD_REPLY_RETRY 5 |
| 52 | 51 | ||
| 53 | #define CX82310_MTU 1514 | 52 | #define CX82310_MTU 1514 |
| @@ -78,8 +77,9 @@ static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply, | |||
| 78 | ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, CMD_EP), buf, | 77 | ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, CMD_EP), buf, |
| 79 | CMD_PACKET_SIZE, &actual_len, CMD_TIMEOUT); | 78 | CMD_PACKET_SIZE, &actual_len, CMD_TIMEOUT); |
| 80 | if (ret < 0) { | 79 | if (ret < 0) { |
| 81 | dev_err(&dev->udev->dev, "send command %#x: error %d\n", | 80 | if (cmd != CMD_GET_LINK_STATUS) |
| 82 | cmd, ret); | 81 | dev_err(&dev->udev->dev, "send command %#x: error %d\n", |
| 82 | cmd, ret); | ||
| 83 | goto end; | 83 | goto end; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| @@ -90,8 +90,10 @@ static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply, | |||
| 90 | buf, CMD_PACKET_SIZE, &actual_len, | 90 | buf, CMD_PACKET_SIZE, &actual_len, |
| 91 | CMD_TIMEOUT); | 91 | CMD_TIMEOUT); |
| 92 | if (ret < 0) { | 92 | if (ret < 0) { |
| 93 | dev_err(&dev->udev->dev, | 93 | if (cmd != CMD_GET_LINK_STATUS) |
| 94 | "reply receive error %d\n", ret); | 94 | dev_err(&dev->udev->dev, |
| 95 | "reply receive error %d\n", | ||
| 96 | ret); | ||
| 95 | goto end; | 97 | goto end; |
| 96 | } | 98 | } |
| 97 | if (actual_len > 0) | 99 | if (actual_len > 0) |
| @@ -134,6 +136,8 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) | |||
| 134 | int ret; | 136 | int ret; |
| 135 | char buf[15]; | 137 | char buf[15]; |
| 136 | struct usb_device *udev = dev->udev; | 138 | struct usb_device *udev = dev->udev; |
| 139 | u8 link[3]; | ||
| 140 | int timeout = 50; | ||
| 137 | 141 | ||
| 138 | /* avoid ADSL modems - continue only if iProduct is "USB NET CARD" */ | 142 | /* avoid ADSL modems - continue only if iProduct is "USB NET CARD" */ |
| 139 | if (usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) > 0 | 143 | if (usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) > 0 |
| @@ -160,6 +164,20 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) | |||
| 160 | if (!dev->partial_data) | 164 | if (!dev->partial_data) |
| 161 | return -ENOMEM; | 165 | return -ENOMEM; |
| 162 | 166 | ||
| 167 | /* wait for firmware to become ready (indicated by the link being up) */ | ||
| 168 | while (--timeout) { | ||
| 169 | ret = cx82310_cmd(dev, CMD_GET_LINK_STATUS, true, NULL, 0, | ||
| 170 | link, sizeof(link)); | ||
| 171 | /* the command can time out during boot - it's not an error */ | ||
| 172 | if (!ret && link[0] == 1 && link[2] == 1) | ||
| 173 | break; | ||
| 174 | msleep(500); | ||
| 175 | }; | ||
| 176 | if (!timeout) { | ||
| 177 | dev_err(&udev->dev, "firmware not ready in time\n"); | ||
| 178 | return -ETIMEDOUT; | ||
| 179 | } | ||
| 180 | |||
| 163 | /* enable ethernet mode (?) */ | 181 | /* enable ethernet mode (?) */ |
| 164 | ret = cx82310_cmd(dev, CMD_ETHERNET_MODE, true, "\x01", 1, NULL, 0); | 182 | ret = cx82310_cmd(dev, CMD_ETHERNET_MODE, true, "\x01", 1, NULL, 0); |
| 165 | if (ret) { | 183 | if (ret) { |
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h index 534e1f2ac4fc..57639fca223a 100644 --- a/include/net/netfilter/nf_log.h +++ b/include/net/netfilter/nf_log.h | |||
| @@ -79,6 +79,16 @@ void nf_log_packet(struct net *net, | |||
| 79 | const struct nf_loginfo *li, | 79 | const struct nf_loginfo *li, |
| 80 | const char *fmt, ...); | 80 | const char *fmt, ...); |
| 81 | 81 | ||
| 82 | __printf(8, 9) | ||
| 83 | void nf_log_trace(struct net *net, | ||
| 84 | u_int8_t pf, | ||
| 85 | unsigned int hooknum, | ||
| 86 | const struct sk_buff *skb, | ||
| 87 | const struct net_device *in, | ||
| 88 | const struct net_device *out, | ||
| 89 | const struct nf_loginfo *li, | ||
| 90 | const char *fmt, ...); | ||
| 91 | |||
| 82 | struct nf_log_buf; | 92 | struct nf_log_buf; |
| 83 | 93 | ||
| 84 | struct nf_log_buf *nf_log_buf_open(void); | 94 | struct nf_log_buf *nf_log_buf_open(void); |
diff --git a/net/compat.c b/net/compat.c index 94d3d5e97883..f7bd286a8280 100644 --- a/net/compat.c +++ b/net/compat.c | |||
| @@ -49,6 +49,13 @@ ssize_t get_compat_msghdr(struct msghdr *kmsg, | |||
| 49 | __get_user(kmsg->msg_controllen, &umsg->msg_controllen) || | 49 | __get_user(kmsg->msg_controllen, &umsg->msg_controllen) || |
| 50 | __get_user(kmsg->msg_flags, &umsg->msg_flags)) | 50 | __get_user(kmsg->msg_flags, &umsg->msg_flags)) |
| 51 | return -EFAULT; | 51 | return -EFAULT; |
| 52 | |||
| 53 | if (!uaddr) | ||
| 54 | kmsg->msg_namelen = 0; | ||
| 55 | |||
| 56 | if (kmsg->msg_namelen < 0) | ||
| 57 | return -EINVAL; | ||
| 58 | |||
| 52 | if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) | 59 | if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) |
| 53 | kmsg->msg_namelen = sizeof(struct sockaddr_storage); | 60 | kmsg->msg_namelen = sizeof(struct sockaddr_storage); |
| 54 | kmsg->msg_control = compat_ptr(tmp3); | 61 | kmsg->msg_control = compat_ptr(tmp3); |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 99e810f84671..cf5e82f39d3b 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
| @@ -272,9 +272,9 @@ static void trace_packet(const struct sk_buff *skb, | |||
| 272 | &chainname, &comment, &rulenum) != 0) | 272 | &chainname, &comment, &rulenum) != 0) |
| 273 | break; | 273 | break; |
| 274 | 274 | ||
| 275 | nf_log_packet(net, AF_INET, hook, skb, in, out, &trace_loginfo, | 275 | nf_log_trace(net, AF_INET, hook, skb, in, out, &trace_loginfo, |
| 276 | "TRACE: %s:%s:%s:%u ", | 276 | "TRACE: %s:%s:%s:%u ", |
| 277 | tablename, chainname, comment, rulenum); | 277 | tablename, chainname, comment, rulenum); |
| 278 | } | 278 | } |
| 279 | #endif | 279 | #endif |
| 280 | 280 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index a2a796c5536b..1db253e36045 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -2773,15 +2773,11 @@ void tcp_send_fin(struct sock *sk) | |||
| 2773 | } else { | 2773 | } else { |
| 2774 | /* Socket is locked, keep trying until memory is available. */ | 2774 | /* Socket is locked, keep trying until memory is available. */ |
| 2775 | for (;;) { | 2775 | for (;;) { |
| 2776 | skb = alloc_skb_fclone(MAX_TCP_HEADER, | 2776 | skb = sk_stream_alloc_skb(sk, 0, sk->sk_allocation); |
| 2777 | sk->sk_allocation); | ||
| 2778 | if (skb) | 2777 | if (skb) |
| 2779 | break; | 2778 | break; |
| 2780 | yield(); | 2779 | yield(); |
| 2781 | } | 2780 | } |
| 2782 | |||
| 2783 | /* Reserve space for headers and prepare control bits. */ | ||
| 2784 | skb_reserve(skb, MAX_TCP_HEADER); | ||
| 2785 | /* FIN eats a sequence byte, write_seq advanced by tcp_queue_skb(). */ | 2781 | /* FIN eats a sequence byte, write_seq advanced by tcp_queue_skb(). */ |
| 2786 | tcp_init_nondata_skb(skb, tp->write_seq, | 2782 | tcp_init_nondata_skb(skb, tp->write_seq, |
| 2787 | TCPHDR_ACK | TCPHDR_FIN); | 2783 | TCPHDR_ACK | TCPHDR_FIN); |
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index b4d5e1d97c1b..27ca79682efb 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
| @@ -104,6 +104,7 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp, | |||
| 104 | goto again; | 104 | goto again; |
| 105 | flp6->saddr = saddr; | 105 | flp6->saddr = saddr; |
| 106 | } | 106 | } |
| 107 | err = rt->dst.error; | ||
| 107 | goto out; | 108 | goto out; |
| 108 | } | 109 | } |
| 109 | again: | 110 | again: |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index e080fbbbc0e5..bb00c6f2a885 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
| @@ -298,9 +298,9 @@ static void trace_packet(const struct sk_buff *skb, | |||
| 298 | &chainname, &comment, &rulenum) != 0) | 298 | &chainname, &comment, &rulenum) != 0) |
| 299 | break; | 299 | break; |
| 300 | 300 | ||
| 301 | nf_log_packet(net, AF_INET6, hook, skb, in, out, &trace_loginfo, | 301 | nf_log_trace(net, AF_INET6, hook, skb, in, out, &trace_loginfo, |
| 302 | "TRACE: %s:%s:%s:%u ", | 302 | "TRACE: %s:%s:%s:%u ", |
| 303 | tablename, chainname, comment, rulenum); | 303 | tablename, chainname, comment, rulenum); |
| 304 | } | 304 | } |
| 305 | #endif | 305 | #endif |
| 306 | 306 | ||
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c index ab889bb16b3c..be2c0ba82c85 100644 --- a/net/ipv6/udp_offload.c +++ b/net/ipv6/udp_offload.c | |||
| @@ -112,11 +112,9 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
| 112 | fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen); | 112 | fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen); |
| 113 | fptr->nexthdr = nexthdr; | 113 | fptr->nexthdr = nexthdr; |
| 114 | fptr->reserved = 0; | 114 | fptr->reserved = 0; |
| 115 | if (skb_shinfo(skb)->ip6_frag_id) | 115 | if (!skb_shinfo(skb)->ip6_frag_id) |
| 116 | fptr->identification = skb_shinfo(skb)->ip6_frag_id; | 116 | ipv6_proxy_select_ident(skb); |
| 117 | else | 117 | fptr->identification = skb_shinfo(skb)->ip6_frag_id; |
| 118 | ipv6_select_ident(fptr, | ||
| 119 | (struct rt6_info *)skb_dst(skb)); | ||
| 120 | 118 | ||
| 121 | /* Fragment the skb. ipv6 header and the remaining fields of the | 119 | /* Fragment the skb. ipv6 header and the remaining fields of the |
| 122 | * fragment header are updated in ipv6_gso_segment() | 120 | * fragment header are updated in ipv6_gso_segment() |
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index 0d8448f19dfe..675d12c69e32 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
| @@ -212,6 +212,30 @@ void nf_log_packet(struct net *net, | |||
| 212 | } | 212 | } |
| 213 | EXPORT_SYMBOL(nf_log_packet); | 213 | EXPORT_SYMBOL(nf_log_packet); |
| 214 | 214 | ||
| 215 | void nf_log_trace(struct net *net, | ||
| 216 | u_int8_t pf, | ||
| 217 | unsigned int hooknum, | ||
| 218 | const struct sk_buff *skb, | ||
| 219 | const struct net_device *in, | ||
| 220 | const struct net_device *out, | ||
| 221 | const struct nf_loginfo *loginfo, const char *fmt, ...) | ||
| 222 | { | ||
| 223 | va_list args; | ||
| 224 | char prefix[NF_LOG_PREFIXLEN]; | ||
| 225 | const struct nf_logger *logger; | ||
| 226 | |||
| 227 | rcu_read_lock(); | ||
| 228 | logger = rcu_dereference(net->nf.nf_loggers[pf]); | ||
| 229 | if (logger) { | ||
| 230 | va_start(args, fmt); | ||
| 231 | vsnprintf(prefix, sizeof(prefix), fmt, args); | ||
| 232 | va_end(args); | ||
| 233 | logger->logfn(net, pf, hooknum, skb, in, out, loginfo, prefix); | ||
| 234 | } | ||
| 235 | rcu_read_unlock(); | ||
| 236 | } | ||
| 237 | EXPORT_SYMBOL(nf_log_trace); | ||
| 238 | |||
| 215 | #define S_SIZE (1024 - (sizeof(unsigned int) + 1)) | 239 | #define S_SIZE (1024 - (sizeof(unsigned int) + 1)) |
| 216 | 240 | ||
| 217 | struct nf_log_buf { | 241 | struct nf_log_buf { |
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 6ab777912237..ac1a9528dbf2 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
| @@ -1225,7 +1225,10 @@ static int nf_tables_newchain(struct sock *nlsk, struct sk_buff *skb, | |||
| 1225 | 1225 | ||
| 1226 | if (nla[NFTA_CHAIN_POLICY]) { | 1226 | if (nla[NFTA_CHAIN_POLICY]) { |
| 1227 | if ((chain != NULL && | 1227 | if ((chain != NULL && |
| 1228 | !(chain->flags & NFT_BASE_CHAIN)) || | 1228 | !(chain->flags & NFT_BASE_CHAIN))) |
| 1229 | return -EOPNOTSUPP; | ||
| 1230 | |||
| 1231 | if (chain == NULL && | ||
| 1229 | nla[NFTA_CHAIN_HOOK] == NULL) | 1232 | nla[NFTA_CHAIN_HOOK] == NULL) |
| 1230 | return -EOPNOTSUPP; | 1233 | return -EOPNOTSUPP; |
| 1231 | 1234 | ||
diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c index 3b90eb2b2c55..2d298dccb6dd 100644 --- a/net/netfilter/nf_tables_core.c +++ b/net/netfilter/nf_tables_core.c | |||
| @@ -94,10 +94,10 @@ static void nft_trace_packet(const struct nft_pktinfo *pkt, | |||
| 94 | { | 94 | { |
| 95 | struct net *net = dev_net(pkt->in ? pkt->in : pkt->out); | 95 | struct net *net = dev_net(pkt->in ? pkt->in : pkt->out); |
| 96 | 96 | ||
| 97 | nf_log_packet(net, pkt->xt.family, pkt->ops->hooknum, pkt->skb, pkt->in, | 97 | nf_log_trace(net, pkt->xt.family, pkt->ops->hooknum, pkt->skb, pkt->in, |
| 98 | pkt->out, &trace_loginfo, "TRACE: %s:%s:%s:%u ", | 98 | pkt->out, &trace_loginfo, "TRACE: %s:%s:%s:%u ", |
| 99 | chain->table->name, chain->name, comments[type], | 99 | chain->table->name, chain->name, comments[type], |
| 100 | rulenum); | 100 | rulenum); |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | unsigned int | 103 | unsigned int |
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c index a5599fc51a6f..54330fb5efaf 100644 --- a/net/netfilter/nfnetlink_cthelper.c +++ b/net/netfilter/nfnetlink_cthelper.c | |||
| @@ -77,6 +77,9 @@ nfnl_cthelper_parse_tuple(struct nf_conntrack_tuple *tuple, | |||
| 77 | if (!tb[NFCTH_TUPLE_L3PROTONUM] || !tb[NFCTH_TUPLE_L4PROTONUM]) | 77 | if (!tb[NFCTH_TUPLE_L3PROTONUM] || !tb[NFCTH_TUPLE_L4PROTONUM]) |
| 78 | return -EINVAL; | 78 | return -EINVAL; |
| 79 | 79 | ||
| 80 | /* Not all fields are initialized so first zero the tuple */ | ||
| 81 | memset(tuple, 0, sizeof(struct nf_conntrack_tuple)); | ||
| 82 | |||
| 80 | tuple->src.l3num = ntohs(nla_get_be16(tb[NFCTH_TUPLE_L3PROTONUM])); | 83 | tuple->src.l3num = ntohs(nla_get_be16(tb[NFCTH_TUPLE_L3PROTONUM])); |
| 81 | tuple->dst.protonum = nla_get_u8(tb[NFCTH_TUPLE_L4PROTONUM]); | 84 | tuple->dst.protonum = nla_get_u8(tb[NFCTH_TUPLE_L4PROTONUM]); |
| 82 | 85 | ||
diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c index 213584cf04b3..65f3e2b6be44 100644 --- a/net/netfilter/nft_compat.c +++ b/net/netfilter/nft_compat.c | |||
| @@ -133,6 +133,9 @@ nft_target_set_tgchk_param(struct xt_tgchk_param *par, | |||
| 133 | entry->e4.ip.invflags = inv ? IPT_INV_PROTO : 0; | 133 | entry->e4.ip.invflags = inv ? IPT_INV_PROTO : 0; |
| 134 | break; | 134 | break; |
| 135 | case AF_INET6: | 135 | case AF_INET6: |
| 136 | if (proto) | ||
| 137 | entry->e6.ipv6.flags |= IP6T_F_PROTO; | ||
| 138 | |||
| 136 | entry->e6.ipv6.proto = proto; | 139 | entry->e6.ipv6.proto = proto; |
| 137 | entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; | 140 | entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; |
| 138 | break; | 141 | break; |
| @@ -344,6 +347,9 @@ nft_match_set_mtchk_param(struct xt_mtchk_param *par, const struct nft_ctx *ctx, | |||
| 344 | entry->e4.ip.invflags = inv ? IPT_INV_PROTO : 0; | 347 | entry->e4.ip.invflags = inv ? IPT_INV_PROTO : 0; |
| 345 | break; | 348 | break; |
| 346 | case AF_INET6: | 349 | case AF_INET6: |
| 350 | if (proto) | ||
| 351 | entry->e6.ipv6.flags |= IP6T_F_PROTO; | ||
| 352 | |||
| 347 | entry->e6.ipv6.proto = proto; | 353 | entry->e6.ipv6.proto = proto; |
| 348 | entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; | 354 | entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; |
| 349 | break; | 355 | break; |
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c index c82df0a48fcd..37c15e674884 100644 --- a/net/netfilter/nft_hash.c +++ b/net/netfilter/nft_hash.c | |||
| @@ -153,6 +153,8 @@ static void nft_hash_walk(const struct nft_ctx *ctx, const struct nft_set *set, | |||
| 153 | iter->err = err; | 153 | iter->err = err; |
| 154 | goto out; | 154 | goto out; |
| 155 | } | 155 | } |
| 156 | |||
| 157 | continue; | ||
| 156 | } | 158 | } |
| 157 | 159 | ||
| 158 | if (iter->count < iter->skip) | 160 | if (iter->count < iter->skip) |
diff --git a/net/netfilter/xt_TPROXY.c b/net/netfilter/xt_TPROXY.c index ef8a926752a9..50e1e5aaf4ce 100644 --- a/net/netfilter/xt_TPROXY.c +++ b/net/netfilter/xt_TPROXY.c | |||
| @@ -513,8 +513,8 @@ static int tproxy_tg6_check(const struct xt_tgchk_param *par) | |||
| 513 | { | 513 | { |
| 514 | const struct ip6t_ip6 *i = par->entryinfo; | 514 | const struct ip6t_ip6 *i = par->entryinfo; |
| 515 | 515 | ||
| 516 | if ((i->proto == IPPROTO_TCP || i->proto == IPPROTO_UDP) | 516 | if ((i->proto == IPPROTO_TCP || i->proto == IPPROTO_UDP) && |
| 517 | && !(i->flags & IP6T_INV_PROTO)) | 517 | !(i->invflags & IP6T_INV_PROTO)) |
| 518 | return 0; | 518 | return 0; |
| 519 | 519 | ||
| 520 | pr_info("Can be used only in combination with " | 520 | pr_info("Can be used only in combination with " |
diff --git a/net/socket.c b/net/socket.c index bbedbfcb42c2..245330ca0015 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -1702,6 +1702,8 @@ SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, | |||
| 1702 | 1702 | ||
| 1703 | if (len > INT_MAX) | 1703 | if (len > INT_MAX) |
| 1704 | len = INT_MAX; | 1704 | len = INT_MAX; |
| 1705 | if (unlikely(!access_ok(VERIFY_READ, buff, len))) | ||
| 1706 | return -EFAULT; | ||
| 1705 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | 1707 | sock = sockfd_lookup_light(fd, &err, &fput_needed); |
| 1706 | if (!sock) | 1708 | if (!sock) |
| 1707 | goto out; | 1709 | goto out; |
| @@ -1760,6 +1762,8 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, | |||
| 1760 | 1762 | ||
| 1761 | if (size > INT_MAX) | 1763 | if (size > INT_MAX) |
| 1762 | size = INT_MAX; | 1764 | size = INT_MAX; |
| 1765 | if (unlikely(!access_ok(VERIFY_WRITE, ubuf, size))) | ||
| 1766 | return -EFAULT; | ||
| 1763 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | 1767 | sock = sockfd_lookup_light(fd, &err, &fput_needed); |
| 1764 | if (!sock) | 1768 | if (!sock) |
| 1765 | goto out; | 1769 | goto out; |
