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) Prevent XFRM per-cpu counter updates for one namespace from being
applied to another namespace. Fix from DanS treetman.

2) Fix RCU de-reference in iwl_mvm_get_key_sta_id(), from Johannes
Berg.

3) Remove ethernet header assumption in nft_do_chain_netdev(), from
Pablo Neira Ayuso.

4) Fix cpsw PHY ident with multiple slaves and fixed-phy, from Pascal
Speck.

5) Fix use after free in sixpack_close and mkiss_close.

6) Fix VXLAN fw assertion on bnx2x, from Yuval Mintz.

7) natsemi doesn't check for DMA mapping errors, from Alexey
Khoroshilov.

8) Fix inverted test in ip6addrlbl_get(), from ANdrey Ryabinin.

9) Missing initialization of needed_headroom in geneve tunnel driver,
from Paolo Abeni.

10) Fix conntrack template leak in openvswitch, from Joe Stringer.

11) Mission initialization of wq->flags in sock_alloc_inode(), from
Nicolai Stange.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (35 commits)
sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close
net, socket, socket_wq: fix missing initialization of flags
drivers: net: cpsw: fix error return code
openvswitch: Fix template leak in error cases.
sctp: label accepted/peeled off sockets
sctp: use GFP_USER for user-controlled kmalloc
qlcnic: fix a loop exit condition better
net: cdc_ncm: avoid changing RX/TX buffers on MTU changes
geneve: initialize needed_headroom
ipv6: honor ifindex in case we receive ll addresses in router advertisements
addrconf: always initialize sysctl table data
ipv6/addrlabel: fix ip6addrlbl_get()
switchdev: bridge: Pass ageing time as clock_t instead of jiffies
sh_eth: fix 16-bit descriptor field access endianness too
veth: don’t modify ip_summed; doing so treats packets with bad checksums as good.
net: usb: cdc_ncm: Adding Dell DW5813 LTE AT&T Mobile Broadband Card
net: usb: cdc_ncm: Adding Dell DW5812 LTE Verizon Mobile Broadband Card
natsemi: add checks for dma mapping errors
rhashtable: Kill harmless RCU warning in rhashtable_walk_init
openvswitch: correct encoding of set tunnel action attributes
...

+334 -198
+3 -3
Documentation/devicetree/bindings/net/cpsw.txt
··· 40 40 41 41 Slave Properties: 42 42 Required properties: 43 - - phy_id : Specifies slave phy id 44 43 - phy-mode : See ethernet.txt file in the same directory 45 44 46 45 Optional properties: 47 46 - dual_emac_res_vlan : Specifies VID to be used to segregate the ports 48 47 - mac-address : See ethernet.txt file in the same directory 48 + - phy_id : Specifies slave phy id 49 49 - phy-handle : See ethernet.txt file in the same directory 50 50 51 51 Slave sub-nodes: 52 52 - fixed-link : See fixed-link.txt file in the same directory 53 - Either the properties phy_id and phy-mode, 54 - or the sub-node fixed-link can be specified 53 + Either the property phy_id, or the sub-node 54 + fixed-link can be specified 55 55 56 56 Note: "ti,hwmods" field is used to fetch the base address and irq 57 57 resources from TI, omap hwmod data base during device registration.
+13 -9
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 3430 3430 return rc; 3431 3431 } 3432 3432 3433 - #if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3) 3433 + /* VXLAN: 4 = 1 (for linear data BD) + 3 (2 for PBD and last BD) */ 3434 + #define BNX2X_NUM_VXLAN_TSO_WIN_SUB_BDS 4 3435 + 3436 + /* Regular: 3 = 1 (for linear data BD) + 2 (for PBD and last BD) */ 3437 + #define BNX2X_NUM_TSO_WIN_SUB_BDS 3 3438 + 3439 + #if (MAX_SKB_FRAGS >= MAX_FETCH_BD - BDS_PER_TX_PKT) 3434 3440 /* check if packet requires linearization (packet is too fragmented) 3435 3441 no need to check fragmentation if page size > 8K (there will be no 3436 3442 violation to FW restrictions) */ 3437 3443 static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb, 3438 3444 u32 xmit_type) 3439 3445 { 3440 - int to_copy = 0; 3441 - int hlen = 0; 3442 - int first_bd_sz = 0; 3446 + int first_bd_sz = 0, num_tso_win_sub = BNX2X_NUM_TSO_WIN_SUB_BDS; 3447 + int to_copy = 0, hlen = 0; 3443 3448 3444 - /* 3 = 1 (for linear data BD) + 2 (for PBD and last BD) */ 3445 - if (skb_shinfo(skb)->nr_frags >= (MAX_FETCH_BD - 3)) { 3449 + if (xmit_type & XMIT_GSO_ENC) 3450 + num_tso_win_sub = BNX2X_NUM_VXLAN_TSO_WIN_SUB_BDS; 3446 3451 3452 + if (skb_shinfo(skb)->nr_frags >= (MAX_FETCH_BD - num_tso_win_sub)) { 3447 3453 if (xmit_type & XMIT_GSO) { 3448 3454 unsigned short lso_mss = skb_shinfo(skb)->gso_size; 3449 - /* Check if LSO packet needs to be copied: 3450 - 3 = 1 (for headers BD) + 2 (for PBD and last BD) */ 3451 - int wnd_size = MAX_FETCH_BD - 3; 3455 + int wnd_size = MAX_FETCH_BD - num_tso_win_sub; 3452 3456 /* Number of windows to check */ 3453 3457 int num_wnds = skb_shinfo(skb)->nr_frags - wnd_size; 3454 3458 int wnd_idx = 0;
+3 -1
drivers/net/ethernet/emulex/benet/be_main.c
··· 3299 3299 3300 3300 return 0; 3301 3301 err_msix: 3302 - for (i--, eqo = &adapter->eq_obj[i]; i >= 0; i--, eqo--) 3302 + for (i--; i >= 0; i--) { 3303 + eqo = &adapter->eq_obj[i]; 3303 3304 free_irq(be_msix_vec_get(adapter, eqo), eqo); 3305 + } 3304 3306 dev_warn(&adapter->pdev->dev, "MSIX Request IRQ failed - err %d\n", 3305 3307 status); 3306 3308 be_msix_disable(adapter);
+7
drivers/net/ethernet/mellanox/mlx4/en_clock.c
··· 242 242 unsigned long flags; 243 243 u64 ns, zero = 0; 244 244 245 + /* mlx4_en_init_timestamp is called for each netdev. 246 + * mdev->ptp_clock is common for all ports, skip initialization if 247 + * was done for other port. 248 + */ 249 + if (mdev->ptp_clock) 250 + return; 251 + 245 252 rwlock_init(&mdev->clock_lock); 246 253 247 254 memset(&mdev->cycles, 0, sizeof(mdev->cycles));
-7
drivers/net/ethernet/mellanox/mlx4/en_main.c
··· 232 232 if (mdev->pndev[i]) 233 233 mlx4_en_destroy_netdev(mdev->pndev[i]); 234 234 235 - if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) 236 - mlx4_en_remove_timestamp(mdev); 237 - 238 235 flush_workqueue(mdev->workqueue); 239 236 destroy_workqueue(mdev->workqueue); 240 237 (void) mlx4_mr_free(dev, &mdev->mr); ··· 316 319 mdev->port_cnt = 0; 317 320 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) 318 321 mdev->port_cnt++; 319 - 320 - /* Initialize time stamp mechanism */ 321 - if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) 322 - mlx4_en_init_timestamp(mdev); 323 322 324 323 /* Set default number of RX rings*/ 325 324 mlx4_en_set_num_rx_rings(mdev);
+8 -2
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
··· 2072 2072 /* flush any pending task for this netdev */ 2073 2073 flush_workqueue(mdev->workqueue); 2074 2074 2075 + if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) 2076 + mlx4_en_remove_timestamp(mdev); 2077 + 2075 2078 /* Detach the netdev so tasks would not attempt to access it */ 2076 2079 mutex_lock(&mdev->state_lock); 2077 2080 mdev->pndev[priv->port] = NULL; ··· 3061 3058 } 3062 3059 queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); 3063 3060 3061 + /* Initialize time stamp mechanism */ 3064 3062 if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) 3065 - queue_delayed_work(mdev->workqueue, &priv->service_task, 3066 - SERVICE_TASK_DELAY); 3063 + mlx4_en_init_timestamp(mdev); 3064 + 3065 + queue_delayed_work(mdev->workqueue, &priv->service_task, 3066 + SERVICE_TASK_DELAY); 3067 3067 3068 3068 mlx4_en_set_stats_bitmap(mdev->dev, &priv->stats_bitmap, 3069 3069 mdev->profile.prof[priv->port].rx_ppp,
+12
drivers/net/ethernet/natsemi/natsemi.c
··· 1937 1937 break; /* Better luck next round. */ 1938 1938 np->rx_dma[entry] = pci_map_single(np->pci_dev, 1939 1939 skb->data, buflen, PCI_DMA_FROMDEVICE); 1940 + if (pci_dma_mapping_error(np->pci_dev, 1941 + np->rx_dma[entry])) { 1942 + dev_kfree_skb_any(skb); 1943 + np->rx_skbuff[entry] = NULL; 1944 + break; /* Better luck next round. */ 1945 + } 1940 1946 np->rx_ring[entry].addr = cpu_to_le32(np->rx_dma[entry]); 1941 1947 } 1942 1948 np->rx_ring[entry].cmd_status = cpu_to_le32(np->rx_buf_sz); ··· 2099 2093 np->tx_skbuff[entry] = skb; 2100 2094 np->tx_dma[entry] = pci_map_single(np->pci_dev, 2101 2095 skb->data,skb->len, PCI_DMA_TODEVICE); 2096 + if (pci_dma_mapping_error(np->pci_dev, np->tx_dma[entry])) { 2097 + np->tx_skbuff[entry] = NULL; 2098 + dev_kfree_skb_irq(skb); 2099 + dev->stats.tx_dropped++; 2100 + return NETDEV_TX_OK; 2101 + } 2102 2102 2103 2103 np->tx_ring[entry].addr = cpu_to_le32(np->tx_dma[entry]); 2104 2104
+1 -1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c
··· 252 252 state = QLCRDX(ahw, QLC_83XX_VNIC_STATE); 253 253 } 254 254 255 - if (!idc->vnic_wait_limit) { 255 + if (state != QLCNIC_DEV_NPAR_OPER) { 256 256 dev_err(&adapter->pdev->dev, 257 257 "vNIC mode not operational, state check timed out.\n"); 258 258 return -EIO;
+14 -11
drivers/net/ethernet/renesas/sh_eth.c
··· 1167 1167 int tx_ringsize = sizeof(*txdesc) * mdp->num_tx_ring; 1168 1168 int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN + 32 - 1; 1169 1169 dma_addr_t dma_addr; 1170 + u32 buf_len; 1170 1171 1171 1172 mdp->cur_rx = 0; 1172 1173 mdp->cur_tx = 0; ··· 1188 1187 /* RX descriptor */ 1189 1188 rxdesc = &mdp->rx_ring[i]; 1190 1189 /* The size of the buffer is a multiple of 32 bytes. */ 1191 - rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 32); 1192 - dma_addr = dma_map_single(&ndev->dev, skb->data, 1193 - rxdesc->buffer_length, 1190 + buf_len = ALIGN(mdp->rx_buf_sz, 32); 1191 + rxdesc->len = cpu_to_edmac(mdp, buf_len << 16); 1192 + dma_addr = dma_map_single(&ndev->dev, skb->data, buf_len, 1194 1193 DMA_FROM_DEVICE); 1195 1194 if (dma_mapping_error(&ndev->dev, dma_addr)) { 1196 1195 kfree_skb(skb); ··· 1221 1220 mdp->tx_skbuff[i] = NULL; 1222 1221 txdesc = &mdp->tx_ring[i]; 1223 1222 txdesc->status = cpu_to_edmac(mdp, TD_TFP); 1224 - txdesc->buffer_length = 0; 1223 + txdesc->len = cpu_to_edmac(mdp, 0); 1225 1224 if (i == 0) { 1226 1225 /* Tx descriptor address set */ 1227 1226 sh_eth_write(ndev, mdp->tx_desc_dma, TDLAR); ··· 1430 1429 if (mdp->tx_skbuff[entry]) { 1431 1430 dma_unmap_single(&ndev->dev, 1432 1431 edmac_to_cpu(mdp, txdesc->addr), 1433 - txdesc->buffer_length, DMA_TO_DEVICE); 1432 + edmac_to_cpu(mdp, txdesc->len) >> 16, 1433 + DMA_TO_DEVICE); 1434 1434 dev_kfree_skb_irq(mdp->tx_skbuff[entry]); 1435 1435 mdp->tx_skbuff[entry] = NULL; 1436 1436 free_num++; ··· 1441 1439 txdesc->status |= cpu_to_edmac(mdp, TD_TDLE); 1442 1440 1443 1441 ndev->stats.tx_packets++; 1444 - ndev->stats.tx_bytes += txdesc->buffer_length; 1442 + ndev->stats.tx_bytes += edmac_to_cpu(mdp, txdesc->len) >> 16; 1445 1443 } 1446 1444 return free_num; 1447 1445 } ··· 1460 1458 u32 desc_status; 1461 1459 int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN + 32 - 1; 1462 1460 dma_addr_t dma_addr; 1461 + u32 buf_len; 1463 1462 1464 1463 boguscnt = min(boguscnt, *quota); 1465 1464 limit = boguscnt; ··· 1469 1466 /* RACT bit must be checked before all the following reads */ 1470 1467 dma_rmb(); 1471 1468 desc_status = edmac_to_cpu(mdp, rxdesc->status); 1472 - pkt_len = rxdesc->frame_length; 1469 + pkt_len = edmac_to_cpu(mdp, rxdesc->len) & RD_RFL; 1473 1470 1474 1471 if (--boguscnt < 0) 1475 1472 break; ··· 1535 1532 entry = mdp->dirty_rx % mdp->num_rx_ring; 1536 1533 rxdesc = &mdp->rx_ring[entry]; 1537 1534 /* The size of the buffer is 32 byte boundary. */ 1538 - rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 32); 1535 + buf_len = ALIGN(mdp->rx_buf_sz, 32); 1536 + rxdesc->len = cpu_to_edmac(mdp, buf_len << 16); 1539 1537 1540 1538 if (mdp->rx_skbuff[entry] == NULL) { 1541 1539 skb = netdev_alloc_skb(ndev, skbuff_size); ··· 1544 1540 break; /* Better luck next round. */ 1545 1541 sh_eth_set_receive_align(skb); 1546 1542 dma_addr = dma_map_single(&ndev->dev, skb->data, 1547 - rxdesc->buffer_length, 1548 - DMA_FROM_DEVICE); 1543 + buf_len, DMA_FROM_DEVICE); 1549 1544 if (dma_mapping_error(&ndev->dev, dma_addr)) { 1550 1545 kfree_skb(skb); 1551 1546 break; ··· 2410 2407 return NETDEV_TX_OK; 2411 2408 } 2412 2409 txdesc->addr = cpu_to_edmac(mdp, dma_addr); 2413 - txdesc->buffer_length = skb->len; 2410 + txdesc->len = cpu_to_edmac(mdp, skb->len << 16); 2414 2411 2415 2412 dma_wmb(); /* TACT bit must be set after all the above writes */ 2416 2413 if (entry >= mdp->num_tx_ring - 1)
+16 -17
drivers/net/ethernet/renesas/sh_eth.h
··· 283 283 DMAC_M_RINT1 = 0x00000001, 284 284 }; 285 285 286 - /* Receive descriptor bit */ 286 + /* Receive descriptor 0 bits */ 287 287 enum RD_STS_BIT { 288 288 RD_RACT = 0x80000000, RD_RDLE = 0x40000000, 289 289 RD_RFP1 = 0x20000000, RD_RFP0 = 0x10000000, ··· 298 298 #define RDFEND RD_RFP0 299 299 #define RD_RFP (RD_RFP1|RD_RFP0) 300 300 301 + /* Receive descriptor 1 bits */ 302 + enum RD_LEN_BIT { 303 + RD_RFL = 0x0000ffff, /* receive frame length */ 304 + RD_RBL = 0xffff0000, /* receive buffer length */ 305 + }; 306 + 301 307 /* FCFTR */ 302 308 enum FCFTR_BIT { 303 309 FCFTR_RFF2 = 0x00040000, FCFTR_RFF1 = 0x00020000, ··· 313 307 #define DEFAULT_FIFO_F_D_RFF (FCFTR_RFF2 | FCFTR_RFF1 | FCFTR_RFF0) 314 308 #define DEFAULT_FIFO_F_D_RFD (FCFTR_RFD2 | FCFTR_RFD1 | FCFTR_RFD0) 315 309 316 - /* Transmit descriptor bit */ 310 + /* Transmit descriptor 0 bits */ 317 311 enum TD_STS_BIT { 318 312 TD_TACT = 0x80000000, TD_TDLE = 0x40000000, 319 313 TD_TFP1 = 0x20000000, TD_TFP0 = 0x10000000, ··· 322 316 #define TDF1ST TD_TFP1 323 317 #define TDFEND TD_TFP0 324 318 #define TD_TFP (TD_TFP1|TD_TFP0) 319 + 320 + /* Transmit descriptor 1 bits */ 321 + enum TD_LEN_BIT { 322 + TD_TBL = 0xffff0000, /* transmit buffer length */ 323 + }; 325 324 326 325 /* RMCR */ 327 326 enum RMCR_BIT { ··· 436 425 */ 437 426 struct sh_eth_txdesc { 438 427 u32 status; /* TD0 */ 439 - #if defined(__LITTLE_ENDIAN) 440 - u16 pad0; /* TD1 */ 441 - u16 buffer_length; /* TD1 */ 442 - #else 443 - u16 buffer_length; /* TD1 */ 444 - u16 pad0; /* TD1 */ 445 - #endif 428 + u32 len; /* TD1 */ 446 429 u32 addr; /* TD2 */ 447 - u32 pad1; /* padding data */ 430 + u32 pad0; /* padding data */ 448 431 } __aligned(2) __packed; 449 432 450 433 /* The sh ether Rx buffer descriptors. ··· 446 441 */ 447 442 struct sh_eth_rxdesc { 448 443 u32 status; /* RD0 */ 449 - #if defined(__LITTLE_ENDIAN) 450 - u16 frame_length; /* RD1 */ 451 - u16 buffer_length; /* RD1 */ 452 - #else 453 - u16 buffer_length; /* RD1 */ 454 - u16 frame_length; /* RD1 */ 455 - #endif 444 + u32 len; /* RD1 */ 456 445 u32 addr; /* RD2 */ 457 446 u32 pad0; /* padding data */ 458 447 } __aligned(2) __packed;
+38 -25
drivers/net/ethernet/ti/cpsw.c
··· 2026 2026 for_each_child_of_node(node, slave_node) { 2027 2027 struct cpsw_slave_data *slave_data = data->slave_data + i; 2028 2028 const void *mac_addr = NULL; 2029 - u32 phyid; 2030 2029 int lenp; 2031 2030 const __be32 *parp; 2032 - struct device_node *mdio_node; 2033 - struct platform_device *mdio; 2034 2031 2035 2032 /* This is no slave child node, continue */ 2036 2033 if (strcmp(slave_node->name, "slave")) 2037 2034 continue; 2038 2035 2039 2036 priv->phy_node = of_parse_phandle(slave_node, "phy-handle", 0); 2037 + parp = of_get_property(slave_node, "phy_id", &lenp); 2040 2038 if (of_phy_is_fixed_link(slave_node)) { 2041 - struct phy_device *pd; 2039 + struct device_node *phy_node; 2040 + struct phy_device *phy_dev; 2042 2041 2042 + /* In the case of a fixed PHY, the DT node associated 2043 + * to the PHY is the Ethernet MAC DT node. 2044 + */ 2043 2045 ret = of_phy_register_fixed_link(slave_node); 2044 2046 if (ret) 2045 2047 return ret; 2046 - pd = of_phy_find_device(slave_node); 2047 - if (!pd) 2048 + phy_node = of_node_get(slave_node); 2049 + phy_dev = of_phy_find_device(phy_node); 2050 + if (!phy_dev) 2048 2051 return -ENODEV; 2049 2052 snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), 2050 - PHY_ID_FMT, pd->bus->id, pd->phy_id); 2053 + PHY_ID_FMT, phy_dev->bus->id, phy_dev->addr); 2054 + } else if (parp) { 2055 + u32 phyid; 2056 + struct device_node *mdio_node; 2057 + struct platform_device *mdio; 2058 + 2059 + if (lenp != (sizeof(__be32) * 2)) { 2060 + dev_err(&pdev->dev, "Invalid slave[%d] phy_id property\n", i); 2061 + goto no_phy_slave; 2062 + } 2063 + mdio_node = of_find_node_by_phandle(be32_to_cpup(parp)); 2064 + phyid = be32_to_cpup(parp+1); 2065 + mdio = of_find_device_by_node(mdio_node); 2066 + of_node_put(mdio_node); 2067 + if (!mdio) { 2068 + dev_err(&pdev->dev, "Missing mdio platform device\n"); 2069 + return -EINVAL; 2070 + } 2071 + snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), 2072 + PHY_ID_FMT, mdio->name, phyid); 2073 + } else { 2074 + dev_err(&pdev->dev, "No slave[%d] phy_id or fixed-link property\n", i); 2051 2075 goto no_phy_slave; 2052 2076 } 2053 - parp = of_get_property(slave_node, "phy_id", &lenp); 2054 - if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { 2055 - dev_err(&pdev->dev, "Missing slave[%d] phy_id property\n", i); 2056 - goto no_phy_slave; 2057 - } 2058 - mdio_node = of_find_node_by_phandle(be32_to_cpup(parp)); 2059 - phyid = be32_to_cpup(parp+1); 2060 - mdio = of_find_device_by_node(mdio_node); 2061 - of_node_put(mdio_node); 2062 - if (!mdio) { 2063 - dev_err(&pdev->dev, "Missing mdio platform device\n"); 2064 - return -EINVAL; 2065 - } 2066 - snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), 2067 - PHY_ID_FMT, mdio->name, phyid); 2068 2077 slave_data->phy_if = of_get_phy_mode(slave_node); 2069 2078 if (slave_data->phy_if < 0) { 2070 2079 dev_err(&pdev->dev, "Missing or malformed slave[%d] phy-mode property\n", ··· 2427 2418 ndev->irq = platform_get_irq(pdev, 1); 2428 2419 if (ndev->irq < 0) { 2429 2420 dev_err(priv->dev, "error getting irq resource\n"); 2430 - ret = -ENOENT; 2421 + ret = ndev->irq; 2431 2422 goto clean_ale_ret; 2432 2423 } 2433 2424 ··· 2448 2439 2449 2440 /* RX IRQ */ 2450 2441 irq = platform_get_irq(pdev, 1); 2451 - if (irq < 0) 2442 + if (irq < 0) { 2443 + ret = irq; 2452 2444 goto clean_ale_ret; 2445 + } 2453 2446 2454 2447 priv->irqs_table[0] = irq; 2455 2448 ret = devm_request_irq(&pdev->dev, irq, cpsw_rx_interrupt, ··· 2463 2452 2464 2453 /* TX IRQ */ 2465 2454 irq = platform_get_irq(pdev, 2); 2466 - if (irq < 0) 2455 + if (irq < 0) { 2456 + ret = irq; 2467 2457 goto clean_ale_ret; 2458 + } 2468 2459 2469 2460 priv->irqs_table[1] = irq; 2470 2461 ret = devm_request_irq(&pdev->dev, irq, cpsw_tx_interrupt,
+9 -1
drivers/net/geneve.c
··· 1155 1155 struct geneve_net *gn = net_generic(net, geneve_net_id); 1156 1156 struct geneve_dev *t, *geneve = netdev_priv(dev); 1157 1157 bool tun_collect_md, tun_on_same_port; 1158 - int err; 1158 + int err, encap_len; 1159 1159 1160 1160 if (!remote) 1161 1161 return -EINVAL; ··· 1186 1186 &tun_on_same_port, &tun_collect_md); 1187 1187 if (t) 1188 1188 return -EBUSY; 1189 + 1190 + /* make enough headroom for basic scenario */ 1191 + encap_len = GENEVE_BASE_HLEN + ETH_HLEN; 1192 + if (remote->sa.sa_family == AF_INET) 1193 + encap_len += sizeof(struct iphdr); 1194 + else 1195 + encap_len += sizeof(struct ipv6hdr); 1196 + dev->needed_headroom = encap_len + ETH_HLEN; 1189 1197 1190 1198 if (metadata) { 1191 1199 if (tun_on_same_port)
+4 -4
drivers/net/hamradio/6pack.c
··· 683 683 if (!atomic_dec_and_test(&sp->refcnt)) 684 684 down(&sp->dead_sem); 685 685 686 - unregister_netdev(sp->dev); 687 - 688 - del_timer(&sp->tx_t); 689 - del_timer(&sp->resync_t); 686 + del_timer_sync(&sp->tx_t); 687 + del_timer_sync(&sp->resync_t); 690 688 691 689 /* Free all 6pack frame buffers. */ 692 690 kfree(sp->rbuff); 693 691 kfree(sp->xbuff); 692 + 693 + unregister_netdev(sp->dev); 694 694 } 695 695 696 696 /* Perform I/O control on an active 6pack channel. */
+2 -2
drivers/net/hamradio/mkiss.c
··· 798 798 if (!atomic_dec_and_test(&ax->refcnt)) 799 799 down(&ax->dead_sem); 800 800 801 - unregister_netdev(ax->dev); 802 - 803 801 /* Free all AX25 frame buffers. */ 804 802 kfree(ax->rbuff); 805 803 kfree(ax->xbuff); 806 804 807 805 ax->tty = NULL; 806 + 807 + unregister_netdev(ax->dev); 808 808 } 809 809 810 810 /* Perform I/O control on an active ax25 channel. */
+1 -1
drivers/net/usb/cdc_mbim.c
··· 100 100 .ndo_stop = usbnet_stop, 101 101 .ndo_start_xmit = usbnet_start_xmit, 102 102 .ndo_tx_timeout = usbnet_tx_timeout, 103 - .ndo_change_mtu = usbnet_change_mtu, 103 + .ndo_change_mtu = cdc_ncm_change_mtu, 104 104 .ndo_set_mac_address = eth_mac_addr, 105 105 .ndo_validate_addr = eth_validate_addr, 106 106 .ndo_vlan_rx_add_vid = cdc_mbim_rx_add_vid,
+49
drivers/net/usb/cdc_ncm.c
··· 41 41 #include <linux/module.h> 42 42 #include <linux/netdevice.h> 43 43 #include <linux/ctype.h> 44 + #include <linux/etherdevice.h> 44 45 #include <linux/ethtool.h> 45 46 #include <linux/workqueue.h> 46 47 #include <linux/mii.h> ··· 690 689 kfree(ctx); 691 690 } 692 691 692 + /* we need to override the usbnet change_mtu ndo for two reasons: 693 + * - respect the negotiated maximum datagram size 694 + * - avoid unwanted changes to rx and tx buffers 695 + */ 696 + int cdc_ncm_change_mtu(struct net_device *net, int new_mtu) 697 + { 698 + struct usbnet *dev = netdev_priv(net); 699 + struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; 700 + int maxmtu = ctx->max_datagram_size - cdc_ncm_eth_hlen(dev); 701 + 702 + if (new_mtu <= 0 || new_mtu > maxmtu) 703 + return -EINVAL; 704 + net->mtu = new_mtu; 705 + return 0; 706 + } 707 + EXPORT_SYMBOL_GPL(cdc_ncm_change_mtu); 708 + 709 + static const struct net_device_ops cdc_ncm_netdev_ops = { 710 + .ndo_open = usbnet_open, 711 + .ndo_stop = usbnet_stop, 712 + .ndo_start_xmit = usbnet_start_xmit, 713 + .ndo_tx_timeout = usbnet_tx_timeout, 714 + .ndo_change_mtu = cdc_ncm_change_mtu, 715 + .ndo_set_mac_address = eth_mac_addr, 716 + .ndo_validate_addr = eth_validate_addr, 717 + }; 718 + 693 719 int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting, int drvflags) 694 720 { 695 721 struct cdc_ncm_ctx *ctx; ··· 850 822 851 823 /* add our sysfs attrs */ 852 824 dev->net->sysfs_groups[0] = &cdc_ncm_sysfs_attr_group; 825 + 826 + /* must handle MTU changes */ 827 + dev->net->netdev_ops = &cdc_ncm_netdev_ops; 853 828 854 829 return 0; 855 830 ··· 1587 1556 .bInterfaceSubClass = USB_CDC_SUBCLASS_NCM, 1588 1557 .bInterfaceProtocol = USB_CDC_PROTO_NONE, 1589 1558 .driver_info = (unsigned long) &wwan_info, 1559 + }, 1560 + 1561 + /* DW5812 LTE Verizon Mobile Broadband Card 1562 + * Unlike DW5550 this device requires FLAG_NOARP 1563 + */ 1564 + { USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x81bb, 1565 + USB_CLASS_COMM, 1566 + USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), 1567 + .driver_info = (unsigned long)&wwan_noarp_info, 1568 + }, 1569 + 1570 + /* DW5813 LTE AT&T Mobile Broadband Card 1571 + * Unlike DW5550 this device requires FLAG_NOARP 1572 + */ 1573 + { USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x81bc, 1574 + USB_CLASS_COMM, 1575 + USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), 1576 + .driver_info = (unsigned long)&wwan_noarp_info, 1590 1577 }, 1591 1578 1592 1579 /* Dell branded MBM devices like DW5550 */
-6
drivers/net/veth.c
··· 117 117 kfree_skb(skb); 118 118 goto drop; 119 119 } 120 - /* don't change ip_summed == CHECKSUM_PARTIAL, as that 121 - * will cause bad checksum on forwarded packets 122 - */ 123 - if (skb->ip_summed == CHECKSUM_NONE && 124 - rcv->features & NETIF_F_RXCSUM) 125 - skb->ip_summed = CHECKSUM_UNNECESSARY; 126 120 127 121 if (likely(dev_forward_skb(rcv, skb) == NET_RX_SUCCESS)) { 128 122 struct pcpu_vstats *stats = this_cpu_ptr(dev->vstats);
+35 -14
drivers/net/wireless/iwlwifi/iwl-7000.c
··· 69 69 #include "iwl-agn-hw.h" 70 70 71 71 /* Highest firmware API version supported */ 72 - #define IWL7260_UCODE_API_MAX 19 72 + #define IWL7260_UCODE_API_MAX 17 73 + #define IWL7265_UCODE_API_MAX 19 74 + #define IWL7265D_UCODE_API_MAX 19 73 75 74 76 /* Oldest version we won't warn about */ 75 77 #define IWL7260_UCODE_API_OK 13 78 + #define IWL7265_UCODE_API_OK 13 79 + #define IWL7265D_UCODE_API_OK 13 76 80 77 81 /* Lowest firmware API version supported */ 78 82 #define IWL7260_UCODE_API_MIN 13 83 + #define IWL7265_UCODE_API_MIN 13 84 + #define IWL7265D_UCODE_API_MIN 13 79 85 80 86 /* NVM versions */ 81 87 #define IWL7260_NVM_VERSION 0x0a1d ··· 155 149 .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), 156 150 }; 157 151 158 - #define IWL_DEVICE_7000 \ 159 - .ucode_api_max = IWL7260_UCODE_API_MAX, \ 160 - .ucode_api_ok = IWL7260_UCODE_API_OK, \ 161 - .ucode_api_min = IWL7260_UCODE_API_MIN, \ 152 + #define IWL_DEVICE_7000_COMMON \ 162 153 .device_family = IWL_DEVICE_FAMILY_7000, \ 163 154 .max_inst_size = IWL60_RTC_INST_SIZE, \ 164 155 .max_data_size = IWL60_RTC_DATA_SIZE, \ ··· 165 162 .non_shared_ant = ANT_A, \ 166 163 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ 167 164 .dccm_offset = IWL7000_DCCM_OFFSET 165 + 166 + #define IWL_DEVICE_7000 \ 167 + IWL_DEVICE_7000_COMMON, \ 168 + .ucode_api_max = IWL7260_UCODE_API_MAX, \ 169 + .ucode_api_ok = IWL7260_UCODE_API_OK, \ 170 + .ucode_api_min = IWL7260_UCODE_API_MIN 171 + 172 + #define IWL_DEVICE_7005 \ 173 + IWL_DEVICE_7000_COMMON, \ 174 + .ucode_api_max = IWL7265_UCODE_API_MAX, \ 175 + .ucode_api_ok = IWL7265_UCODE_API_OK, \ 176 + .ucode_api_min = IWL7265_UCODE_API_MIN 177 + 178 + #define IWL_DEVICE_7005D \ 179 + IWL_DEVICE_7000_COMMON, \ 180 + .ucode_api_max = IWL7265D_UCODE_API_MAX, \ 181 + .ucode_api_ok = IWL7265D_UCODE_API_OK, \ 182 + .ucode_api_min = IWL7265D_UCODE_API_MIN 168 183 169 184 const struct iwl_cfg iwl7260_2ac_cfg = { 170 185 .name = "Intel(R) Dual Band Wireless AC 7260", ··· 287 266 const struct iwl_cfg iwl3165_2ac_cfg = { 288 267 .name = "Intel(R) Dual Band Wireless AC 3165", 289 268 .fw_name_pre = IWL7265D_FW_PRE, 290 - IWL_DEVICE_7000, 269 + IWL_DEVICE_7005D, 291 270 .ht_params = &iwl7000_ht_params, 292 271 .nvm_ver = IWL3165_NVM_VERSION, 293 272 .nvm_calib_ver = IWL3165_TX_POWER_VERSION, ··· 298 277 const struct iwl_cfg iwl7265_2ac_cfg = { 299 278 .name = "Intel(R) Dual Band Wireless AC 7265", 300 279 .fw_name_pre = IWL7265_FW_PRE, 301 - IWL_DEVICE_7000, 280 + IWL_DEVICE_7005, 302 281 .ht_params = &iwl7265_ht_params, 303 282 .nvm_ver = IWL7265_NVM_VERSION, 304 283 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, ··· 309 288 const struct iwl_cfg iwl7265_2n_cfg = { 310 289 .name = "Intel(R) Dual Band Wireless N 7265", 311 290 .fw_name_pre = IWL7265_FW_PRE, 312 - IWL_DEVICE_7000, 291 + IWL_DEVICE_7005, 313 292 .ht_params = &iwl7265_ht_params, 314 293 .nvm_ver = IWL7265_NVM_VERSION, 315 294 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, ··· 320 299 const struct iwl_cfg iwl7265_n_cfg = { 321 300 .name = "Intel(R) Wireless N 7265", 322 301 .fw_name_pre = IWL7265_FW_PRE, 323 - IWL_DEVICE_7000, 302 + IWL_DEVICE_7005, 324 303 .ht_params = &iwl7265_ht_params, 325 304 .nvm_ver = IWL7265_NVM_VERSION, 326 305 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, ··· 331 310 const struct iwl_cfg iwl7265d_2ac_cfg = { 332 311 .name = "Intel(R) Dual Band Wireless AC 7265", 333 312 .fw_name_pre = IWL7265D_FW_PRE, 334 - IWL_DEVICE_7000, 313 + IWL_DEVICE_7005D, 335 314 .ht_params = &iwl7265_ht_params, 336 315 .nvm_ver = IWL7265D_NVM_VERSION, 337 316 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, ··· 342 321 const struct iwl_cfg iwl7265d_2n_cfg = { 343 322 .name = "Intel(R) Dual Band Wireless N 7265", 344 323 .fw_name_pre = IWL7265D_FW_PRE, 345 - IWL_DEVICE_7000, 324 + IWL_DEVICE_7005D, 346 325 .ht_params = &iwl7265_ht_params, 347 326 .nvm_ver = IWL7265D_NVM_VERSION, 348 327 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, ··· 353 332 const struct iwl_cfg iwl7265d_n_cfg = { 354 333 .name = "Intel(R) Wireless N 7265", 355 334 .fw_name_pre = IWL7265D_FW_PRE, 356 - IWL_DEVICE_7000, 335 + IWL_DEVICE_7005D, 357 336 .ht_params = &iwl7265_ht_params, 358 337 .nvm_ver = IWL7265D_NVM_VERSION, 359 338 .nvm_calib_ver = IWL7265_TX_POWER_VERSION, ··· 363 342 364 343 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 365 344 MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 366 - MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 367 - MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK)); 345 + MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_OK)); 346 + MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_OK));
+9 -6
drivers/net/wireless/iwlwifi/mvm/sta.c
··· 1222 1222 mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { 1223 1223 u8 sta_id = mvmvif->ap_sta_id; 1224 1224 1225 - sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], 1226 - lockdep_is_held(&mvm->mutex)); 1225 + sta = rcu_dereference_check(mvm->fw_id_to_mac_id[sta_id], 1226 + lockdep_is_held(&mvm->mutex)); 1227 1227 /* 1228 1228 * It is possible that the 'sta' parameter is NULL, 1229 1229 * for example when a GTK is removed - the sta_id will then ··· 1590 1590 u16 *phase1key) 1591 1591 { 1592 1592 struct iwl_mvm_sta *mvm_sta; 1593 - u8 sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta); 1593 + u8 sta_id; 1594 1594 bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE); 1595 1595 1596 - if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT)) 1597 - return; 1598 - 1599 1596 rcu_read_lock(); 1597 + 1598 + sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta); 1599 + if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT)) 1600 + goto unlock; 1600 1601 1601 1602 if (!sta) { 1602 1603 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); ··· 1610 1609 mvm_sta = iwl_mvm_sta_from_mac80211(sta); 1611 1610 iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, 1612 1611 iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx); 1612 + 1613 + unlock: 1613 1614 rcu_read_unlock(); 1614 1615 } 1615 1616
+1
include/linux/usb/cdc_ncm.h
··· 138 138 }; 139 139 140 140 u8 cdc_ncm_select_altsetting(struct usb_interface *intf); 141 + int cdc_ncm_change_mtu(struct net_device *net, int new_mtu); 141 142 int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting, int drvflags); 142 143 void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); 143 144 struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign);
+2 -1
lib/rhashtable.c
··· 519 519 return -ENOMEM; 520 520 521 521 spin_lock(&ht->lock); 522 - iter->walker->tbl = rht_dereference(ht->tbl, ht); 522 + iter->walker->tbl = 523 + rcu_dereference_protected(ht->tbl, lockdep_is_held(&ht->lock)); 523 524 list_add(&iter->walker->list, &iter->walker->tbl->walkers); 524 525 spin_unlock(&ht->lock); 525 526
+1 -1
net/bridge/br_stp_if.c
··· 39 39 struct switchdev_attr attr = { 40 40 .id = SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME, 41 41 .flags = SWITCHDEV_F_SKIP_EOPNOTSUPP | SWITCHDEV_F_DEFER, 42 - .u.ageing_time = p->br->ageing_time, 42 + .u.ageing_time = jiffies_to_clock_t(p->br->ageing_time), 43 43 }; 44 44 int err; 45 45
-3
net/ipv4/ipip.c
··· 253 253 254 254 p.i_key = p.o_key = 0; 255 255 p.i_flags = p.o_flags = 0; 256 - if (p.iph.ttl) 257 - p.iph.frag_off |= htons(IP_DF); 258 - 259 256 err = ip_tunnel_ioctl(dev, &p, cmd); 260 257 if (err) 261 258 return err;
+37 -9
net/ipv4/xfrm4_policy.c
··· 259 259 xfrm_dst_ifdown(dst, dev); 260 260 } 261 261 262 - static struct dst_ops xfrm4_dst_ops = { 262 + static struct dst_ops xfrm4_dst_ops_template = { 263 263 .family = AF_INET, 264 264 .gc = xfrm4_garbage_collect, 265 265 .update_pmtu = xfrm4_update_pmtu, ··· 273 273 274 274 static struct xfrm_policy_afinfo xfrm4_policy_afinfo = { 275 275 .family = AF_INET, 276 - .dst_ops = &xfrm4_dst_ops, 276 + .dst_ops = &xfrm4_dst_ops_template, 277 277 .dst_lookup = xfrm4_dst_lookup, 278 278 .get_saddr = xfrm4_get_saddr, 279 279 .decode_session = _decode_session4, ··· 295 295 { } 296 296 }; 297 297 298 - static int __net_init xfrm4_net_init(struct net *net) 298 + static int __net_init xfrm4_net_sysctl_init(struct net *net) 299 299 { 300 300 struct ctl_table *table; 301 301 struct ctl_table_header *hdr; ··· 323 323 return -ENOMEM; 324 324 } 325 325 326 - static void __net_exit xfrm4_net_exit(struct net *net) 326 + static void __net_exit xfrm4_net_sysctl_exit(struct net *net) 327 327 { 328 328 struct ctl_table *table; 329 329 ··· 335 335 if (!net_eq(net, &init_net)) 336 336 kfree(table); 337 337 } 338 + #else /* CONFIG_SYSCTL */ 339 + static int inline xfrm4_net_sysctl_init(struct net *net) 340 + { 341 + return 0; 342 + } 343 + 344 + static void inline xfrm4_net_sysctl_exit(struct net *net) 345 + { 346 + } 347 + #endif 348 + 349 + static int __net_init xfrm4_net_init(struct net *net) 350 + { 351 + int ret; 352 + 353 + memcpy(&net->xfrm.xfrm4_dst_ops, &xfrm4_dst_ops_template, 354 + sizeof(xfrm4_dst_ops_template)); 355 + ret = dst_entries_init(&net->xfrm.xfrm4_dst_ops); 356 + if (ret) 357 + return ret; 358 + 359 + ret = xfrm4_net_sysctl_init(net); 360 + if (ret) 361 + dst_entries_destroy(&net->xfrm.xfrm4_dst_ops); 362 + 363 + return ret; 364 + } 365 + 366 + static void __net_exit xfrm4_net_exit(struct net *net) 367 + { 368 + xfrm4_net_sysctl_exit(net); 369 + dst_entries_destroy(&net->xfrm.xfrm4_dst_ops); 370 + } 338 371 339 372 static struct pernet_operations __net_initdata xfrm4_net_ops = { 340 373 .init = xfrm4_net_init, 341 374 .exit = xfrm4_net_exit, 342 375 }; 343 - #endif 344 376 345 377 static void __init xfrm4_policy_init(void) 346 378 { ··· 381 349 382 350 void __init xfrm4_init(void) 383 351 { 384 - dst_entries_init(&xfrm4_dst_ops); 385 - 386 352 xfrm4_state_init(); 387 353 xfrm4_policy_init(); 388 354 xfrm4_protocol_init(); 389 - #ifdef CONFIG_SYSCTL 390 355 register_pernet_subsys(&xfrm4_net_ops); 391 - #endif 392 356 } 393 357
+4 -7
net/ipv6/addrconf.c
··· 5369 5369 goto out; 5370 5370 } 5371 5371 5372 - if (!write) { 5373 - err = snprintf(str, sizeof(str), "%pI6", 5374 - &secret->secret); 5375 - if (err >= sizeof(str)) { 5376 - err = -EIO; 5377 - goto out; 5378 - } 5372 + err = snprintf(str, sizeof(str), "%pI6", &secret->secret); 5373 + if (err >= sizeof(str)) { 5374 + err = -EIO; 5375 + goto out; 5379 5376 } 5380 5377 5381 5378 err = proc_dostring(&lctl, write, buffer, lenp, ppos);
+1 -1
net/ipv6/addrlabel.c
··· 552 552 553 553 rcu_read_lock(); 554 554 p = __ipv6_addr_label(net, addr, ipv6_addr_type(addr), ifal->ifal_index); 555 - if (p && ip6addrlbl_hold(p)) 555 + if (p && !ip6addrlbl_hold(p)) 556 556 p = NULL; 557 557 lseq = ip6addrlbl_table.seq; 558 558 rcu_read_unlock();
+2 -2
net/ipv6/ndisc.c
··· 1183 1183 */ 1184 1184 if (!in6_dev->cnf.accept_ra_from_local && 1185 1185 ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr, 1186 - NULL, 0)) { 1186 + in6_dev->dev, 0)) { 1187 1187 ND_PRINTK(2, info, 1188 1188 "RA from local address detected on dev: %s: default router ignored\n", 1189 1189 skb->dev->name); ··· 1337 1337 #ifdef CONFIG_IPV6_ROUTE_INFO 1338 1338 if (!in6_dev->cnf.accept_ra_from_local && 1339 1339 ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr, 1340 - NULL, 0)) { 1340 + in6_dev->dev, 0)) { 1341 1341 ND_PRINTK(2, info, 1342 1342 "RA from local address detected on dev: %s: router info ignored.\n", 1343 1343 skb->dev->name);
+38 -15
net/ipv6/xfrm6_policy.c
··· 279 279 xfrm_dst_ifdown(dst, dev); 280 280 } 281 281 282 - static struct dst_ops xfrm6_dst_ops = { 282 + static struct dst_ops xfrm6_dst_ops_template = { 283 283 .family = AF_INET6, 284 284 .gc = xfrm6_garbage_collect, 285 285 .update_pmtu = xfrm6_update_pmtu, ··· 293 293 294 294 static struct xfrm_policy_afinfo xfrm6_policy_afinfo = { 295 295 .family = AF_INET6, 296 - .dst_ops = &xfrm6_dst_ops, 296 + .dst_ops = &xfrm6_dst_ops_template, 297 297 .dst_lookup = xfrm6_dst_lookup, 298 298 .get_saddr = xfrm6_get_saddr, 299 299 .decode_session = _decode_session6, ··· 325 325 { } 326 326 }; 327 327 328 - static int __net_init xfrm6_net_init(struct net *net) 328 + static int __net_init xfrm6_net_sysctl_init(struct net *net) 329 329 { 330 330 struct ctl_table *table; 331 331 struct ctl_table_header *hdr; ··· 353 353 return -ENOMEM; 354 354 } 355 355 356 - static void __net_exit xfrm6_net_exit(struct net *net) 356 + static void __net_exit xfrm6_net_sysctl_exit(struct net *net) 357 357 { 358 358 struct ctl_table *table; 359 359 ··· 365 365 if (!net_eq(net, &init_net)) 366 366 kfree(table); 367 367 } 368 + #else /* CONFIG_SYSCTL */ 369 + static int inline xfrm6_net_sysctl_init(struct net *net) 370 + { 371 + return 0; 372 + } 373 + 374 + static void inline xfrm6_net_sysctl_exit(struct net *net) 375 + { 376 + } 377 + #endif 378 + 379 + static int __net_init xfrm6_net_init(struct net *net) 380 + { 381 + int ret; 382 + 383 + memcpy(&net->xfrm.xfrm6_dst_ops, &xfrm6_dst_ops_template, 384 + sizeof(xfrm6_dst_ops_template)); 385 + ret = dst_entries_init(&net->xfrm.xfrm6_dst_ops); 386 + if (ret) 387 + return ret; 388 + 389 + ret = xfrm6_net_sysctl_init(net); 390 + if (ret) 391 + dst_entries_destroy(&net->xfrm.xfrm6_dst_ops); 392 + 393 + return ret; 394 + } 395 + 396 + static void __net_exit xfrm6_net_exit(struct net *net) 397 + { 398 + xfrm6_net_sysctl_exit(net); 399 + dst_entries_destroy(&net->xfrm.xfrm6_dst_ops); 400 + } 368 401 369 402 static struct pernet_operations xfrm6_net_ops = { 370 403 .init = xfrm6_net_init, 371 404 .exit = xfrm6_net_exit, 372 405 }; 373 - #endif 374 406 375 407 int __init xfrm6_init(void) 376 408 { 377 409 int ret; 378 410 379 - dst_entries_init(&xfrm6_dst_ops); 380 - 381 411 ret = xfrm6_policy_init(); 382 - if (ret) { 383 - dst_entries_destroy(&xfrm6_dst_ops); 412 + if (ret) 384 413 goto out; 385 - } 386 414 ret = xfrm6_state_init(); 387 415 if (ret) 388 416 goto out_policy; ··· 419 391 if (ret) 420 392 goto out_state; 421 393 422 - #ifdef CONFIG_SYSCTL 423 394 register_pernet_subsys(&xfrm6_net_ops); 424 - #endif 425 395 out: 426 396 return ret; 427 397 out_state: ··· 431 405 432 406 void xfrm6_fini(void) 433 407 { 434 - #ifdef CONFIG_SYSCTL 435 408 unregister_pernet_subsys(&xfrm6_net_ops); 436 - #endif 437 409 xfrm6_protocol_fini(); 438 410 xfrm6_policy_fini(); 439 411 xfrm6_state_fini(); 440 - dst_entries_destroy(&xfrm6_dst_ops); 441 412 }
+1 -1
net/netfilter/nf_tables_netdev.c
··· 94 94 { 95 95 struct nft_pktinfo pkt; 96 96 97 - switch (eth_hdr(skb)->h_proto) { 97 + switch (skb->protocol) { 98 98 case htons(ETH_P_IP): 99 99 nft_netdev_set_pktinfo_ipv4(&pkt, skb, state); 100 100 break;
+1
net/netfilter/nft_ct.c
··· 366 366 goto nla_put_failure; 367 367 368 368 switch (priv->key) { 369 + case NFT_CT_L3PROTOCOL: 369 370 case NFT_CT_PROTOCOL: 370 371 case NFT_CT_SRC: 371 372 case NFT_CT_DST:
+4 -2
net/openvswitch/conntrack.c
··· 698 698 OVS_NLERR(log, "Failed to allocate conntrack template"); 699 699 return -ENOMEM; 700 700 } 701 + 702 + __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status); 703 + nf_conntrack_get(&ct_info.ct->ct_general); 704 + 701 705 if (helper) { 702 706 err = ovs_ct_add_helper(&ct_info, helper, key, log); 703 707 if (err) ··· 713 709 if (err) 714 710 goto err_free_ct; 715 711 716 - __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status); 717 - nf_conntrack_get(&ct_info.ct->ct_general); 718 712 return 0; 719 713 err_free_ct: 720 714 __ovs_ct_free_action(&ct_info);
+4 -1
net/openvswitch/flow_netlink.c
··· 2434 2434 if (!start) 2435 2435 return -EMSGSIZE; 2436 2436 2437 - err = ovs_nla_put_tunnel_info(skb, tun_info); 2437 + err = ip_tun_to_nlattr(skb, &tun_info->key, 2438 + ip_tunnel_info_opts(tun_info), 2439 + tun_info->options_len, 2440 + ip_tunnel_info_af(tun_info)); 2438 2441 if (err) 2439 2442 return err; 2440 2443 nla_nest_end(skb, start);
+4 -2
net/sctp/sm_statefuns.c
··· 4829 4829 4830 4830 retval = SCTP_DISPOSITION_CONSUME; 4831 4831 4832 - sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 4832 + if (abort) 4833 + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 4833 4834 4834 4835 /* Even if we can't send the ABORT due to low memory delete the 4835 4836 * TCB. This is a departure from our typical NOMEM handling. ··· 4967 4966 SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); 4968 4967 retval = SCTP_DISPOSITION_CONSUME; 4969 4968 4970 - sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 4969 + if (abort) 4970 + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 4971 4971 4972 4972 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, 4973 4973 SCTP_STATE(SCTP_STATE_CLOSED));
+9 -5
net/sctp/socket.c
··· 1301 1301 int addrs_size, 1302 1302 sctp_assoc_t *assoc_id) 1303 1303 { 1304 - int err = 0; 1305 1304 struct sockaddr *kaddrs; 1305 + gfp_t gfp = GFP_KERNEL; 1306 + int err = 0; 1306 1307 1307 1308 pr_debug("%s: sk:%p addrs:%p addrs_size:%d\n", 1308 1309 __func__, sk, addrs, addrs_size); ··· 1316 1315 return -EFAULT; 1317 1316 1318 1317 /* Alloc space for the address array in kernel memory. */ 1319 - kaddrs = kmalloc(addrs_size, GFP_KERNEL); 1318 + if (sk->sk_socket->file) 1319 + gfp = GFP_USER | __GFP_NOWARN; 1320 + kaddrs = kmalloc(addrs_size, gfp); 1320 1321 if (unlikely(!kaddrs)) 1321 1322 return -ENOMEM; 1322 1323 ··· 1516 1513 struct sctp_chunk *chunk; 1517 1514 1518 1515 chunk = sctp_make_abort_user(asoc, NULL, 0); 1519 - if (chunk) 1520 - sctp_primitive_ABORT(net, asoc, chunk); 1516 + sctp_primitive_ABORT(net, asoc, chunk); 1521 1517 } else 1522 1518 sctp_primitive_SHUTDOWN(net, asoc, NULL); 1523 1519 } ··· 5775 5773 5776 5774 len = sizeof(struct sctp_assoc_ids) + sizeof(sctp_assoc_t) * num; 5777 5775 5778 - ids = kmalloc(len, GFP_KERNEL); 5776 + ids = kmalloc(len, GFP_USER | __GFP_NOWARN); 5779 5777 if (unlikely(!ids)) 5780 5778 return -ENOMEM; 5781 5779 ··· 7201 7199 7202 7200 if (newsk->sk_flags & SK_FLAGS_TIMESTAMP) 7203 7201 net_enable_timestamp(); 7202 + 7203 + security_sk_clone(sk, newsk); 7204 7204 } 7205 7205 7206 7206 static inline void sctp_copy_descendant(struct sock *sk_to,
+1
net/socket.c
··· 257 257 } 258 258 init_waitqueue_head(&wq->wait); 259 259 wq->fasync_list = NULL; 260 + wq->flags = 0; 260 261 RCU_INIT_POINTER(ei->socket.wq, wq); 261 262 262 263 ei->socket.state = SS_UNCONNECTED;
-38
net/xfrm/xfrm_policy.c
··· 2826 2826 2827 2827 int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) 2828 2828 { 2829 - struct net *net; 2830 2829 int err = 0; 2831 2830 if (unlikely(afinfo == NULL)) 2832 2831 return -EINVAL; ··· 2855 2856 rcu_assign_pointer(xfrm_policy_afinfo[afinfo->family], afinfo); 2856 2857 } 2857 2858 spin_unlock(&xfrm_policy_afinfo_lock); 2858 - 2859 - rtnl_lock(); 2860 - for_each_net(net) { 2861 - struct dst_ops *xfrm_dst_ops; 2862 - 2863 - switch (afinfo->family) { 2864 - case AF_INET: 2865 - xfrm_dst_ops = &net->xfrm.xfrm4_dst_ops; 2866 - break; 2867 - #if IS_ENABLED(CONFIG_IPV6) 2868 - case AF_INET6: 2869 - xfrm_dst_ops = &net->xfrm.xfrm6_dst_ops; 2870 - break; 2871 - #endif 2872 - default: 2873 - BUG(); 2874 - } 2875 - *xfrm_dst_ops = *afinfo->dst_ops; 2876 - } 2877 - rtnl_unlock(); 2878 2859 2879 2860 return err; 2880 2861 } ··· 2890 2911 return err; 2891 2912 } 2892 2913 EXPORT_SYMBOL(xfrm_policy_unregister_afinfo); 2893 - 2894 - static void __net_init xfrm_dst_ops_init(struct net *net) 2895 - { 2896 - struct xfrm_policy_afinfo *afinfo; 2897 - 2898 - rcu_read_lock(); 2899 - afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET]); 2900 - if (afinfo) 2901 - net->xfrm.xfrm4_dst_ops = *afinfo->dst_ops; 2902 - #if IS_ENABLED(CONFIG_IPV6) 2903 - afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET6]); 2904 - if (afinfo) 2905 - net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops; 2906 - #endif 2907 - rcu_read_unlock(); 2908 - } 2909 2914 2910 2915 static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr) 2911 2916 { ··· 3039 3076 rv = xfrm_policy_init(net); 3040 3077 if (rv < 0) 3041 3078 goto out_policy; 3042 - xfrm_dst_ops_init(net); 3043 3079 rv = xfrm_sysctl_init(net); 3044 3080 if (rv < 0) 3045 3081 goto out_sysctl;