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) Handle multicast packets properly in fast-RX path of mac80211, from
Johannes Berg.

2) Because of a logic bug, the user can't actually force SW
checksumming on r8152 devices. This makes diagnosis of hw
checksumming bugs really annoying. Fix from Hayes Wang.

3) VXLAN route lookup does not take the source and destination ports
into account, which means IPSEC policies cannot be matched properly.
Fix from Martynas Pumputis.

4) Do proper RCU locking in netvsc callbacks, from Stephen Hemminger.

5) Fix SKB leaks in mlxsw driver, from Arkadi Sharshevsky.

6) If lwtunnel_fill_encap() fails, we do not abort the netlink message
construction properly in fib_dump_info(), from David Ahern.

7) Do not use kernel stack for DMA buffers in atusb driver, from Stefan
Schmidt.

8) Openvswitch conntack actions need to maintain a correct checksum,
fix from Lance Richardson.

9) ax25_disconnect() is missing a check for ax25->sk being NULL, in
fact it already checks this, but not in all of the necessary spots.
Fix from Basil Gunn.

10) Action GET operations in the packet scheduler can erroneously bump
the reference count of the entry, making it unreleasable. Fix from
Jamal Hadi Salim. Jamal gives a great set of example command lines
that trigger this in the commit message.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (46 commits)
net sched actions: fix refcnt when GETing of action after bind
net/mlx4_core: Eliminate warning messages for SRQ_LIMIT under SRIOV
net/mlx4_core: Fix when to save some qp context flags for dynamic VST to VGT transitions
net/mlx4_core: Fix racy CQ (Completion Queue) free
net: stmmac: don't use netdev_[dbg, info, ..] before net_device is registered
net/mlx5e: Fix a -Wmaybe-uninitialized warning
ax25: Fix segfault after sock connection timeout
bpf: rework prog_digest into prog_tag
tipc: allocate user memory with GFP_KERNEL flag
net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types
ip6_tunnel: Account for tunnel header in tunnel MTU
mld: do not remove mld souce list info when set link down
be2net: fix MAC addr setting on privileged BE3 VFs
be2net: don't delete MAC on close on unprivileged BE3 VFs
be2net: fix status check in be_cmd_pmac_add()
cpmac: remove hopeless #warning
ravb: do not use zero-length alignment DMA descriptor
mlx4: do not call napi_schedule() without care
openvswitch: maintain correct checksum state in conntrack actions
tcp: fix tcp_fastopen unaligned access complaints on sparc
...

+384 -210
+4 -2
Documentation/devicetree/bindings/net/ti,dp83867.txt
··· 3 3 Required properties: 4 4 - reg - The ID number for the phy, usually a small integer 5 5 - ti,rx-internal-delay - RGMII Receive Clock Delay - see dt-bindings/net/ti-dp83867.h 6 - for applicable values 6 + for applicable values. Required only if interface type is 7 + PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_RXID 7 8 - ti,tx-internal-delay - RGMII Transmit Clock Delay - see dt-bindings/net/ti-dp83867.h 8 - for applicable values 9 + for applicable values. Required only if interface type is 10 + PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_TXID 9 11 - ti,fifo-depth - Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h 10 12 for applicable values 11 13
+18 -7
drivers/net/ethernet/broadcom/bcmsysport.c
··· 710 710 unsigned int c_index, last_c_index, last_tx_cn, num_tx_cbs; 711 711 unsigned int pkts_compl = 0, bytes_compl = 0; 712 712 struct bcm_sysport_cb *cb; 713 - struct netdev_queue *txq; 714 713 u32 hw_ind; 715 - 716 - txq = netdev_get_tx_queue(ndev, ring->index); 717 714 718 715 /* Compute how many descriptors have been processed since last call */ 719 716 hw_ind = tdma_readl(priv, TDMA_DESC_RING_PROD_CONS_INDEX(ring->index)); ··· 742 745 743 746 ring->c_index = c_index; 744 747 745 - if (netif_tx_queue_stopped(txq) && pkts_compl) 746 - netif_tx_wake_queue(txq); 747 - 748 748 netif_dbg(priv, tx_done, ndev, 749 749 "ring=%d c_index=%d pkts_compl=%d, bytes_compl=%d\n", 750 750 ring->index, ring->c_index, pkts_compl, bytes_compl); ··· 753 759 static unsigned int bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, 754 760 struct bcm_sysport_tx_ring *ring) 755 761 { 762 + struct netdev_queue *txq; 756 763 unsigned int released; 757 764 unsigned long flags; 758 765 766 + txq = netdev_get_tx_queue(priv->netdev, ring->index); 767 + 759 768 spin_lock_irqsave(&ring->lock, flags); 760 769 released = __bcm_sysport_tx_reclaim(priv, ring); 770 + if (released) 771 + netif_tx_wake_queue(txq); 772 + 761 773 spin_unlock_irqrestore(&ring->lock, flags); 762 774 763 775 return released; 776 + } 777 + 778 + /* Locked version of the per-ring TX reclaim, but does not wake the queue */ 779 + static void bcm_sysport_tx_clean(struct bcm_sysport_priv *priv, 780 + struct bcm_sysport_tx_ring *ring) 781 + { 782 + unsigned long flags; 783 + 784 + spin_lock_irqsave(&ring->lock, flags); 785 + __bcm_sysport_tx_reclaim(priv, ring); 786 + spin_unlock_irqrestore(&ring->lock, flags); 764 787 } 765 788 766 789 static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget) ··· 1263 1252 napi_disable(&ring->napi); 1264 1253 netif_napi_del(&ring->napi); 1265 1254 1266 - bcm_sysport_tx_reclaim(priv, ring); 1255 + bcm_sysport_tx_clean(priv, ring); 1267 1256 1268 1257 kfree(ring->cbs); 1269 1258 ring->cbs = NULL;
+6 -5
drivers/net/ethernet/cavium/thunder/thunder_bgx.c
··· 47 47 struct bgx { 48 48 u8 bgx_id; 49 49 struct lmac lmac[MAX_LMAC_PER_BGX]; 50 - int lmac_count; 50 + u8 lmac_count; 51 51 u8 max_lmac; 52 + u8 acpi_lmac_idx; 52 53 void __iomem *reg_base; 53 54 struct pci_dev *pdev; 54 55 bool is_dlm; ··· 1144 1143 if (acpi_bus_get_device(handle, &adev)) 1145 1144 goto out; 1146 1145 1147 - acpi_get_mac_address(dev, adev, bgx->lmac[bgx->lmac_count].mac); 1146 + acpi_get_mac_address(dev, adev, bgx->lmac[bgx->acpi_lmac_idx].mac); 1148 1147 1149 - SET_NETDEV_DEV(&bgx->lmac[bgx->lmac_count].netdev, dev); 1148 + SET_NETDEV_DEV(&bgx->lmac[bgx->acpi_lmac_idx].netdev, dev); 1150 1149 1151 - bgx->lmac[bgx->lmac_count].lmacid = bgx->lmac_count; 1150 + bgx->lmac[bgx->acpi_lmac_idx].lmacid = bgx->acpi_lmac_idx; 1151 + bgx->acpi_lmac_idx++; /* move to next LMAC */ 1152 1152 out: 1153 - bgx->lmac_count++; 1154 1153 return AE_OK; 1155 1154 } 1156 1155
+1 -1
drivers/net/ethernet/emulex/benet/be_cmds.c
··· 1118 1118 err: 1119 1119 mutex_unlock(&adapter->mcc_lock); 1120 1120 1121 - if (status == MCC_STATUS_UNAUTHORIZED_REQUEST) 1121 + if (base_status(status) == MCC_STATUS_UNAUTHORIZED_REQUEST) 1122 1122 status = -EPERM; 1123 1123 1124 1124 return status;
+15 -3
drivers/net/ethernet/emulex/benet/be_main.c
··· 318 318 if (ether_addr_equal(addr->sa_data, adapter->dev_mac)) 319 319 return 0; 320 320 321 + /* BE3 VFs without FILTMGMT privilege are not allowed to set its MAC 322 + * address 323 + */ 324 + if (BEx_chip(adapter) && be_virtfn(adapter) && 325 + !check_privilege(adapter, BE_PRIV_FILTMGMT)) 326 + return -EPERM; 327 + 321 328 /* if device is not running, copy MAC to netdev->dev_addr */ 322 329 if (!netif_running(netdev)) 323 330 goto done; ··· 3616 3609 3617 3610 static void be_disable_if_filters(struct be_adapter *adapter) 3618 3611 { 3619 - be_dev_mac_del(adapter, adapter->pmac_id[0]); 3612 + /* Don't delete MAC on BE3 VFs without FILTMGMT privilege */ 3613 + if (!BEx_chip(adapter) || !be_virtfn(adapter) || 3614 + check_privilege(adapter, BE_PRIV_FILTMGMT)) 3615 + be_dev_mac_del(adapter, adapter->pmac_id[0]); 3616 + 3620 3617 be_clear_uc_list(adapter); 3621 3618 be_clear_mc_list(adapter); 3622 3619 ··· 3773 3762 if (status) 3774 3763 return status; 3775 3764 3776 - /* For BE3 VFs, the PF programs the initial MAC address */ 3777 - if (!(BEx_chip(adapter) && be_virtfn(adapter))) { 3765 + /* Don't add MAC on BE3 VFs without FILTMGMT privilege */ 3766 + if (!BEx_chip(adapter) || !be_virtfn(adapter) || 3767 + check_privilege(adapter, BE_PRIV_FILTMGMT)) { 3778 3768 status = be_dev_mac_add(adapter, adapter->netdev->dev_addr); 3779 3769 if (status) 3780 3770 return status;
+20 -18
drivers/net/ethernet/mellanox/mlx4/cq.c
··· 101 101 { 102 102 struct mlx4_cq *cq; 103 103 104 + rcu_read_lock(); 104 105 cq = radix_tree_lookup(&mlx4_priv(dev)->cq_table.tree, 105 106 cqn & (dev->caps.num_cqs - 1)); 107 + rcu_read_unlock(); 108 + 106 109 if (!cq) { 107 110 mlx4_dbg(dev, "Completion event for bogus CQ %08x\n", cqn); 108 111 return; 109 112 } 110 113 114 + /* Acessing the CQ outside of rcu_read_lock is safe, because 115 + * the CQ is freed only after interrupt handling is completed. 116 + */ 111 117 ++cq->arm_sn; 112 118 113 119 cq->comp(cq); ··· 124 118 struct mlx4_cq_table *cq_table = &mlx4_priv(dev)->cq_table; 125 119 struct mlx4_cq *cq; 126 120 127 - spin_lock(&cq_table->lock); 128 - 121 + rcu_read_lock(); 129 122 cq = radix_tree_lookup(&cq_table->tree, cqn & (dev->caps.num_cqs - 1)); 130 - if (cq) 131 - atomic_inc(&cq->refcount); 132 - 133 - spin_unlock(&cq_table->lock); 123 + rcu_read_unlock(); 134 124 135 125 if (!cq) { 136 - mlx4_warn(dev, "Async event for bogus CQ %08x\n", cqn); 126 + mlx4_dbg(dev, "Async event for bogus CQ %08x\n", cqn); 137 127 return; 138 128 } 139 129 130 + /* Acessing the CQ outside of rcu_read_lock is safe, because 131 + * the CQ is freed only after interrupt handling is completed. 132 + */ 140 133 cq->event(cq, event_type); 141 - 142 - if (atomic_dec_and_test(&cq->refcount)) 143 - complete(&cq->free); 144 134 } 145 135 146 136 static int mlx4_SW2HW_CQ(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox, ··· 303 301 if (err) 304 302 return err; 305 303 306 - spin_lock_irq(&cq_table->lock); 304 + spin_lock(&cq_table->lock); 307 305 err = radix_tree_insert(&cq_table->tree, cq->cqn, cq); 308 - spin_unlock_irq(&cq_table->lock); 306 + spin_unlock(&cq_table->lock); 309 307 if (err) 310 308 goto err_icm; 311 309 ··· 351 349 return 0; 352 350 353 351 err_radix: 354 - spin_lock_irq(&cq_table->lock); 352 + spin_lock(&cq_table->lock); 355 353 radix_tree_delete(&cq_table->tree, cq->cqn); 356 - spin_unlock_irq(&cq_table->lock); 354 + spin_unlock(&cq_table->lock); 357 355 358 356 err_icm: 359 357 mlx4_cq_free_icm(dev, cq->cqn); ··· 372 370 if (err) 373 371 mlx4_warn(dev, "HW2SW_CQ failed (%d) for CQN %06x\n", err, cq->cqn); 374 372 373 + spin_lock(&cq_table->lock); 374 + radix_tree_delete(&cq_table->tree, cq->cqn); 375 + spin_unlock(&cq_table->lock); 376 + 375 377 synchronize_irq(priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(cq->vector)].irq); 376 378 if (priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(cq->vector)].irq != 377 379 priv->eq_table.eq[MLX4_EQ_ASYNC].irq) 378 380 synchronize_irq(priv->eq_table.eq[MLX4_EQ_ASYNC].irq); 379 - 380 - spin_lock_irq(&cq_table->lock); 381 - radix_tree_delete(&cq_table->tree, cq->cqn); 382 - spin_unlock_irq(&cq_table->lock); 383 381 384 382 if (atomic_dec_and_test(&cq->refcount)) 385 383 complete(&cq->free);
+4 -1
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
··· 1748 1748 /* Process all completions if exist to prevent 1749 1749 * the queues freezing if they are full 1750 1750 */ 1751 - for (i = 0; i < priv->rx_ring_num; i++) 1751 + for (i = 0; i < priv->rx_ring_num; i++) { 1752 + local_bh_disable(); 1752 1753 napi_schedule(&priv->rx_cq[i]->napi); 1754 + local_bh_enable(); 1755 + } 1753 1756 1754 1757 netif_tx_start_all_queues(dev); 1755 1758 netif_device_attach(dev);
+14 -9
drivers/net/ethernet/mellanox/mlx4/eq.c
··· 554 554 break; 555 555 556 556 case MLX4_EVENT_TYPE_SRQ_LIMIT: 557 - mlx4_dbg(dev, "%s: MLX4_EVENT_TYPE_SRQ_LIMIT\n", 558 - __func__); 557 + mlx4_dbg(dev, "%s: MLX4_EVENT_TYPE_SRQ_LIMIT. srq_no=0x%x, eq 0x%x\n", 558 + __func__, be32_to_cpu(eqe->event.srq.srqn), 559 + eq->eqn); 559 560 case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR: 560 561 if (mlx4_is_master(dev)) { 561 562 /* forward only to slave owning the SRQ */ ··· 571 570 eq->eqn, eq->cons_index, ret); 572 571 break; 573 572 } 574 - mlx4_warn(dev, "%s: slave:%d, srq_no:0x%x, event: %02x(%02x)\n", 575 - __func__, slave, 576 - be32_to_cpu(eqe->event.srq.srqn), 577 - eqe->type, eqe->subtype); 573 + if (eqe->type == 574 + MLX4_EVENT_TYPE_SRQ_CATAS_ERROR) 575 + mlx4_warn(dev, "%s: slave:%d, srq_no:0x%x, event: %02x(%02x)\n", 576 + __func__, slave, 577 + be32_to_cpu(eqe->event.srq.srqn), 578 + eqe->type, eqe->subtype); 578 579 579 580 if (!ret && slave != dev->caps.function) { 580 - mlx4_warn(dev, "%s: sending event %02x(%02x) to slave:%d\n", 581 - __func__, eqe->type, 582 - eqe->subtype, slave); 581 + if (eqe->type == 582 + MLX4_EVENT_TYPE_SRQ_CATAS_ERROR) 583 + mlx4_warn(dev, "%s: sending event %02x(%02x) to slave:%d\n", 584 + __func__, eqe->type, 585 + eqe->subtype, slave); 583 586 mlx4_slave_event(dev, slave, eqe); 584 587 break; 585 588 }
+3 -2
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
··· 2980 2980 put_res(dev, slave, srqn, RES_SRQ); 2981 2981 qp->srq = srq; 2982 2982 } 2983 + 2984 + /* Save param3 for dynamic changes from VST back to VGT */ 2985 + qp->param3 = qpc->param3; 2983 2986 put_res(dev, slave, rcqn, RES_CQ); 2984 2987 put_res(dev, slave, mtt_base, RES_MTT); 2985 2988 res_end_move(dev, slave, RES_QP, qpn); ··· 3775 3772 int qpn = vhcr->in_modifier & 0x7fffff; 3776 3773 struct res_qp *qp; 3777 3774 u8 orig_sched_queue; 3778 - __be32 orig_param3 = qpc->param3; 3779 3775 u8 orig_vlan_control = qpc->pri_path.vlan_control; 3780 3776 u8 orig_fvl_rx = qpc->pri_path.fvl_rx; 3781 3777 u8 orig_pri_path_fl = qpc->pri_path.fl; ··· 3816 3814 */ 3817 3815 if (!err) { 3818 3816 qp->sched_queue = orig_sched_queue; 3819 - qp->param3 = orig_param3; 3820 3817 qp->vlan_control = orig_vlan_control; 3821 3818 qp->fvl_rx = orig_fvl_rx; 3822 3819 qp->pri_path_fl = orig_pri_path_fl;
+7 -4
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
··· 668 668 int ttl; 669 669 670 670 #if IS_ENABLED(CONFIG_INET) 671 + int ret; 672 + 671 673 rt = ip_route_output_key(dev_net(mirred_dev), fl4); 672 - if (IS_ERR(rt)) 673 - return PTR_ERR(rt); 674 + ret = PTR_ERR_OR_ZERO(rt); 675 + if (ret) 676 + return ret; 674 677 #else 675 678 return -EOPNOTSUPP; 676 679 #endif ··· 744 741 struct flowi4 fl4 = {}; 745 742 char *encap_header; 746 743 int encap_size; 747 - __be32 saddr = 0; 748 - int ttl = 0; 744 + __be32 saddr; 745 + int ttl; 749 746 int err; 750 747 751 748 encap_header = kzalloc(max_encap_size, GFP_KERNEL);
+4 -4
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h
··· 209 209 /* pci_eqe_cmd_token 210 210 * Command completion event - token 211 211 */ 212 - MLXSW_ITEM32(pci, eqe, cmd_token, 0x08, 16, 16); 212 + MLXSW_ITEM32(pci, eqe, cmd_token, 0x00, 16, 16); 213 213 214 214 /* pci_eqe_cmd_status 215 215 * Command completion event - status 216 216 */ 217 - MLXSW_ITEM32(pci, eqe, cmd_status, 0x08, 0, 8); 217 + MLXSW_ITEM32(pci, eqe, cmd_status, 0x00, 0, 8); 218 218 219 219 /* pci_eqe_cmd_out_param_h 220 220 * Command completion event - output parameter - higher part 221 221 */ 222 - MLXSW_ITEM32(pci, eqe, cmd_out_param_h, 0x0C, 0, 32); 222 + MLXSW_ITEM32(pci, eqe, cmd_out_param_h, 0x04, 0, 32); 223 223 224 224 /* pci_eqe_cmd_out_param_l 225 225 * Command completion event - output parameter - lower part 226 226 */ 227 - MLXSW_ITEM32(pci, eqe, cmd_out_param_l, 0x10, 0, 32); 227 + MLXSW_ITEM32(pci, eqe, cmd_out_param_l, 0x08, 0, 32); 228 228 229 229 #endif
+1
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
··· 684 684 dev_kfree_skb_any(skb_orig); 685 685 return NETDEV_TX_OK; 686 686 } 687 + dev_consume_skb_any(skb_orig); 687 688 } 688 689 689 690 if (eth_skb_pad(skb)) {
+1
drivers/net/ethernet/mellanox/mlxsw/switchx2.c
··· 345 345 dev_kfree_skb_any(skb_orig); 346 346 return NETDEV_TX_OK; 347 347 } 348 + dev_consume_skb_any(skb_orig); 348 349 } 349 350 mlxsw_sx_txhdr_construct(skb, &tx_info); 350 351 /* TX header is consumed by HW on the way so we shouldn't count its
+7
drivers/net/ethernet/qualcomm/emac/emac-phy.c
··· 201 201 else 202 202 adpt->phydev = mdiobus_get_phy(mii_bus, phy_addr); 203 203 204 + /* of_phy_find_device() claims a reference to the phydev, 205 + * so we do that here manually as well. When the driver 206 + * later unloads, it can unilaterally drop the reference 207 + * without worrying about ACPI vs DT. 208 + */ 209 + if (adpt->phydev) 210 + get_device(&adpt->phydev->mdio.dev); 204 211 } else { 205 212 struct device_node *phy_np; 206 213
+2 -4
drivers/net/ethernet/qualcomm/emac/emac.c
··· 719 719 err_undo_napi: 720 720 netif_napi_del(&adpt->rx_q.napi); 721 721 err_undo_mdiobus: 722 - if (!has_acpi_companion(&pdev->dev)) 723 - put_device(&adpt->phydev->mdio.dev); 722 + put_device(&adpt->phydev->mdio.dev); 724 723 mdiobus_unregister(adpt->mii_bus); 725 724 err_undo_clocks: 726 725 emac_clks_teardown(adpt); ··· 739 740 740 741 emac_clks_teardown(adpt); 741 742 742 - if (!has_acpi_companion(&pdev->dev)) 743 - put_device(&adpt->phydev->mdio.dev); 743 + put_device(&adpt->phydev->mdio.dev); 744 744 mdiobus_unregister(adpt->mii_bus); 745 745 free_netdev(netdev); 746 746
+15 -6
drivers/net/ethernet/renesas/ravb_main.c
··· 926 926 /* Receive error message handling */ 927 927 priv->rx_over_errors = priv->stats[RAVB_BE].rx_over_errors; 928 928 priv->rx_over_errors += priv->stats[RAVB_NC].rx_over_errors; 929 - if (priv->rx_over_errors != ndev->stats.rx_over_errors) { 929 + if (priv->rx_over_errors != ndev->stats.rx_over_errors) 930 930 ndev->stats.rx_over_errors = priv->rx_over_errors; 931 - netif_err(priv, rx_err, ndev, "Receive Descriptor Empty\n"); 932 - } 933 - if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors) { 931 + if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors) 934 932 ndev->stats.rx_fifo_errors = priv->rx_fifo_errors; 935 - netif_err(priv, rx_err, ndev, "Receive FIFO Overflow\n"); 936 - } 937 933 out: 938 934 return budget - quota; 939 935 } ··· 1504 1508 buffer = PTR_ALIGN(priv->tx_align[q], DPTR_ALIGN) + 1505 1509 entry / NUM_TX_DESC * DPTR_ALIGN; 1506 1510 len = PTR_ALIGN(skb->data, DPTR_ALIGN) - skb->data; 1511 + /* Zero length DMA descriptors are problematic as they seem to 1512 + * terminate DMA transfers. Avoid them by simply using a length of 1513 + * DPTR_ALIGN (4) when skb data is aligned to DPTR_ALIGN. 1514 + * 1515 + * As skb is guaranteed to have at least ETH_ZLEN (60) bytes of 1516 + * data by the call to skb_put_padto() above this is safe with 1517 + * respect to both the length of the first DMA descriptor (len) 1518 + * overflowing the available data and the length of the second DMA 1519 + * descriptor (skb->len - len) being negative. 1520 + */ 1521 + if (len == 0) 1522 + len = DPTR_ALIGN; 1523 + 1507 1524 memcpy(buffer, skb->data, len); 1508 1525 dma_addr = dma_map_single(ndev->dev.parent, buffer, len, DMA_TO_DEVICE); 1509 1526 if (dma_mapping_error(ndev->dev.parent, dma_addr))
+10 -9
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 3326 3326 (priv->plat->maxmtu >= ndev->min_mtu)) 3327 3327 ndev->max_mtu = priv->plat->maxmtu; 3328 3328 else if (priv->plat->maxmtu < ndev->min_mtu) 3329 - netdev_warn(priv->dev, 3330 - "%s: warning: maxmtu having invalid value (%d)\n", 3331 - __func__, priv->plat->maxmtu); 3329 + dev_warn(priv->device, 3330 + "%s: warning: maxmtu having invalid value (%d)\n", 3331 + __func__, priv->plat->maxmtu); 3332 3332 3333 3333 if (flow_ctrl) 3334 3334 priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ ··· 3340 3340 */ 3341 3341 if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) { 3342 3342 priv->use_riwt = 1; 3343 - netdev_info(priv->dev, "Enable RX Mitigation via HW Watchdog Timer\n"); 3343 + dev_info(priv->device, 3344 + "Enable RX Mitigation via HW Watchdog Timer\n"); 3344 3345 } 3345 3346 3346 3347 netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); ··· 3367 3366 /* MDIO bus Registration */ 3368 3367 ret = stmmac_mdio_register(ndev); 3369 3368 if (ret < 0) { 3370 - netdev_err(priv->dev, 3371 - "%s: MDIO bus (id: %d) registration failed", 3372 - __func__, priv->plat->bus_id); 3369 + dev_err(priv->device, 3370 + "%s: MDIO bus (id: %d) registration failed", 3371 + __func__, priv->plat->bus_id); 3373 3372 goto error_mdio_register; 3374 3373 } 3375 3374 } 3376 3375 3377 3376 ret = register_netdev(ndev); 3378 3377 if (ret) { 3379 - netdev_err(priv->dev, "%s: ERROR %i registering the device\n", 3380 - __func__, ret); 3378 + dev_err(priv->device, "%s: ERROR %i registering the device\n", 3379 + __func__, ret); 3381 3380 goto error_netdev_register; 3382 3381 } 3383 3382
+1 -1
drivers/net/ethernet/ti/cpmac.c
··· 1210 1210 goto fail_alloc; 1211 1211 } 1212 1212 1213 - #warning FIXME: unhardcode gpio&reset bits 1213 + /* FIXME: unhardcode gpio&reset bits */ 1214 1214 ar7_gpio_disable(26); 1215 1215 ar7_gpio_disable(27); 1216 1216 ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
+3
drivers/net/hyperv/netvsc_drv.c
··· 659 659 * policy filters on the host). Deliver these via the VF 660 660 * interface in the guest. 661 661 */ 662 + rcu_read_lock(); 662 663 vf_netdev = rcu_dereference(net_device_ctx->vf_netdev); 663 664 if (vf_netdev && (vf_netdev->flags & IFF_UP)) 664 665 net = vf_netdev; ··· 668 667 skb = netvsc_alloc_recv_skb(net, packet, csum_info, *data, vlan_tci); 669 668 if (unlikely(!skb)) { 670 669 ++net->stats.rx_dropped; 670 + rcu_read_unlock(); 671 671 return NVSP_STAT_FAIL; 672 672 } 673 673 ··· 698 696 * TODO - use NAPI? 699 697 */ 700 698 netif_rx(skb); 699 + rcu_read_unlock(); 701 700 702 701 return 0; 703 702 }
+2 -2
drivers/net/ieee802154/at86rf230.c
··· 1715 1715 /* Reset */ 1716 1716 if (gpio_is_valid(rstn)) { 1717 1717 udelay(1); 1718 - gpio_set_value(rstn, 0); 1718 + gpio_set_value_cansleep(rstn, 0); 1719 1719 udelay(1); 1720 - gpio_set_value(rstn, 1); 1720 + gpio_set_value_cansleep(rstn, 1); 1721 1721 usleep_range(120, 240); 1722 1722 } 1723 1723
+43 -16
drivers/net/ieee802154/atusb.c
··· 117 117 { 118 118 struct usb_device *usb_dev = atusb->usb_dev; 119 119 int ret; 120 + uint8_t *buffer; 120 121 uint8_t value; 122 + 123 + buffer = kmalloc(1, GFP_KERNEL); 124 + if (!buffer) 125 + return -ENOMEM; 121 126 122 127 dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg); 123 128 ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0), 124 129 ATUSB_REG_READ, ATUSB_REQ_FROM_DEV, 125 - 0, reg, &value, 1, 1000); 126 - return ret >= 0 ? value : ret; 130 + 0, reg, buffer, 1, 1000); 131 + 132 + if (ret >= 0) { 133 + value = buffer[0]; 134 + kfree(buffer); 135 + return value; 136 + } else { 137 + kfree(buffer); 138 + return ret; 139 + } 127 140 } 128 141 129 142 static int atusb_write_subreg(struct atusb *atusb, uint8_t reg, uint8_t mask, ··· 562 549 atusb_set_frame_retries(struct ieee802154_hw *hw, s8 retries) 563 550 { 564 551 struct atusb *atusb = hw->priv; 565 - struct device *dev = &atusb->usb_dev->dev; 566 - 567 - if (atusb->fw_ver_maj == 0 && atusb->fw_ver_min < 3) { 568 - dev_info(dev, "Automatic frame retransmission is only available from " 569 - "firmware version 0.3. Please update if you want this feature."); 570 - return -EINVAL; 571 - } 572 552 573 553 return atusb_write_subreg(atusb, SR_MAX_FRAME_RETRIES, retries); 574 554 } ··· 614 608 static int atusb_get_and_show_revision(struct atusb *atusb) 615 609 { 616 610 struct usb_device *usb_dev = atusb->usb_dev; 617 - unsigned char buffer[3]; 611 + unsigned char *buffer; 618 612 int ret; 613 + 614 + buffer = kmalloc(3, GFP_KERNEL); 615 + if (!buffer) 616 + return -ENOMEM; 619 617 620 618 /* Get a couple of the ATMega Firmware values */ 621 619 ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0), ··· 641 631 dev_info(&usb_dev->dev, "Please update to version 0.2 or newer"); 642 632 } 643 633 634 + kfree(buffer); 644 635 return ret; 645 636 } 646 637 647 638 static int atusb_get_and_show_build(struct atusb *atusb) 648 639 { 649 640 struct usb_device *usb_dev = atusb->usb_dev; 650 - char build[ATUSB_BUILD_SIZE + 1]; 641 + char *build; 651 642 int ret; 643 + 644 + build = kmalloc(ATUSB_BUILD_SIZE + 1, GFP_KERNEL); 645 + if (!build) 646 + return -ENOMEM; 652 647 653 648 ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0), 654 649 ATUSB_BUILD, ATUSB_REQ_FROM_DEV, 0, 0, ··· 663 648 dev_info(&usb_dev->dev, "Firmware: build %s\n", build); 664 649 } 665 650 651 + kfree(build); 666 652 return ret; 667 653 } 668 654 ··· 714 698 static int atusb_set_extended_addr(struct atusb *atusb) 715 699 { 716 700 struct usb_device *usb_dev = atusb->usb_dev; 717 - unsigned char buffer[IEEE802154_EXTENDED_ADDR_LEN]; 701 + unsigned char *buffer; 718 702 __le64 extended_addr; 719 703 u64 addr; 720 704 int ret; ··· 726 710 return 0; 727 711 } 728 712 713 + buffer = kmalloc(IEEE802154_EXTENDED_ADDR_LEN, GFP_KERNEL); 714 + if (!buffer) 715 + return -ENOMEM; 716 + 729 717 /* Firmware is new enough so we fetch the address from EEPROM */ 730 718 ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0), 731 719 ATUSB_EUI64_READ, ATUSB_REQ_FROM_DEV, 0, 0, 732 720 buffer, IEEE802154_EXTENDED_ADDR_LEN, 1000); 733 - if (ret < 0) 734 - dev_err(&usb_dev->dev, "failed to fetch extended address\n"); 721 + if (ret < 0) { 722 + dev_err(&usb_dev->dev, "failed to fetch extended address, random address set\n"); 723 + ieee802154_random_extended_addr(&atusb->hw->phy->perm_extended_addr); 724 + kfree(buffer); 725 + return ret; 726 + } 735 727 736 728 memcpy(&extended_addr, buffer, IEEE802154_EXTENDED_ADDR_LEN); 737 729 /* Check if read address is not empty and the unicast bit is set correctly */ ··· 753 729 &addr); 754 730 } 755 731 732 + kfree(buffer); 756 733 return ret; 757 734 } 758 735 ··· 795 770 796 771 hw->parent = &usb_dev->dev; 797 772 hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | IEEE802154_HW_AFILT | 798 - IEEE802154_HW_PROMISCUOUS | IEEE802154_HW_CSMA_PARAMS | 799 - IEEE802154_HW_FRAME_RETRIES; 773 + IEEE802154_HW_PROMISCUOUS | IEEE802154_HW_CSMA_PARAMS; 800 774 801 775 hw->phy->flags = WPAN_PHY_FLAG_TXPOWER | WPAN_PHY_FLAG_CCA_ED_LEVEL | 802 776 WPAN_PHY_FLAG_CCA_MODE; ··· 823 799 atusb_get_and_show_revision(atusb); 824 800 atusb_get_and_show_build(atusb); 825 801 atusb_set_extended_addr(atusb); 802 + 803 + if (atusb->fw_ver_maj >= 0 && atusb->fw_ver_min >= 3) 804 + hw->flags |= IEEE802154_HW_FRAME_RETRIES; 826 805 827 806 ret = atusb_get_and_clear_error(atusb); 828 807 if (ret) {
+6 -2
drivers/net/phy/dp83867.c
··· 132 132 133 133 ret = of_property_read_u32(of_node, "ti,rx-internal-delay", 134 134 &dp83867->rx_id_delay); 135 - if (ret) 135 + if (ret && 136 + (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || 137 + phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)) 136 138 return ret; 137 139 138 140 ret = of_property_read_u32(of_node, "ti,tx-internal-delay", 139 141 &dp83867->tx_id_delay); 140 - if (ret) 142 + if (ret && 143 + (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || 144 + phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) 141 145 return ret; 142 146 143 147 return of_property_read_u32(of_node, "ti,fifo-depth",
+6 -1
drivers/net/usb/r8152.c
··· 1730 1730 u8 checksum = CHECKSUM_NONE; 1731 1731 u32 opts2, opts3; 1732 1732 1733 - if (tp->version == RTL_VER_01 || tp->version == RTL_VER_02) 1733 + if (!(tp->netdev->features & NETIF_F_RXCSUM)) 1734 1734 goto return_result; 1735 1735 1736 1736 opts2 = le32_to_cpu(rx_desc->opts2); ··· 4355 4355 netdev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | 4356 4356 NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | 4357 4357 NETIF_F_IPV6_CSUM | NETIF_F_TSO6; 4358 + 4359 + if (tp->version == RTL_VER_01) { 4360 + netdev->features &= ~NETIF_F_RXCSUM; 4361 + netdev->hw_features &= ~NETIF_F_RXCSUM; 4362 + } 4358 4363 4359 4364 netdev->ethtool_ops = &ops; 4360 4365 netif_set_gso_max_size(netdev, RTL_LIMITED_TSO_SIZE);
+10 -3
drivers/net/vxlan.c
··· 1798 1798 static struct rtable *vxlan_get_route(struct vxlan_dev *vxlan, struct net_device *dev, 1799 1799 struct vxlan_sock *sock4, 1800 1800 struct sk_buff *skb, int oif, u8 tos, 1801 - __be32 daddr, __be32 *saddr, 1801 + __be32 daddr, __be32 *saddr, __be16 dport, __be16 sport, 1802 1802 struct dst_cache *dst_cache, 1803 1803 const struct ip_tunnel_info *info) 1804 1804 { ··· 1824 1824 fl4.flowi4_proto = IPPROTO_UDP; 1825 1825 fl4.daddr = daddr; 1826 1826 fl4.saddr = *saddr; 1827 + fl4.fl4_dport = dport; 1828 + fl4.fl4_sport = sport; 1827 1829 1828 1830 rt = ip_route_output_key(vxlan->net, &fl4); 1829 1831 if (likely(!IS_ERR(rt))) { ··· 1853 1851 __be32 label, 1854 1852 const struct in6_addr *daddr, 1855 1853 struct in6_addr *saddr, 1854 + __be16 dport, __be16 sport, 1856 1855 struct dst_cache *dst_cache, 1857 1856 const struct ip_tunnel_info *info) 1858 1857 { ··· 1880 1877 fl6.flowlabel = ip6_make_flowinfo(RT_TOS(tos), label); 1881 1878 fl6.flowi6_mark = skb->mark; 1882 1879 fl6.flowi6_proto = IPPROTO_UDP; 1880 + fl6.fl6_dport = dport; 1881 + fl6.fl6_sport = sport; 1883 1882 1884 1883 err = ipv6_stub->ipv6_dst_lookup(vxlan->net, 1885 1884 sock6->sock->sk, ··· 2073 2068 rdst ? rdst->remote_ifindex : 0, tos, 2074 2069 dst->sin.sin_addr.s_addr, 2075 2070 &src->sin.sin_addr.s_addr, 2071 + dst_port, src_port, 2076 2072 dst_cache, info); 2077 2073 if (IS_ERR(rt)) { 2078 2074 err = PTR_ERR(rt); ··· 2110 2104 rdst ? rdst->remote_ifindex : 0, tos, 2111 2105 label, &dst->sin6.sin6_addr, 2112 2106 &src->sin6.sin6_addr, 2107 + dst_port, src_port, 2113 2108 dst_cache, info); 2114 2109 if (IS_ERR(ndst)) { 2115 2110 err = PTR_ERR(ndst); ··· 2437 2430 2438 2431 rt = vxlan_get_route(vxlan, dev, sock4, skb, 0, info->key.tos, 2439 2432 info->key.u.ipv4.dst, 2440 - &info->key.u.ipv4.src, NULL, info); 2433 + &info->key.u.ipv4.src, dport, sport, NULL, info); 2441 2434 if (IS_ERR(rt)) 2442 2435 return PTR_ERR(rt); 2443 2436 ip_rt_put(rt); ··· 2448 2441 2449 2442 ndst = vxlan6_get_route(vxlan, dev, sock6, skb, 0, info->key.tos, 2450 2443 info->key.label, &info->key.u.ipv6.dst, 2451 - &info->key.u.ipv6.src, NULL, info); 2444 + &info->key.u.ipv6.src, dport, sport, NULL, info); 2452 2445 if (IS_ERR(ndst)) 2453 2446 return PTR_ERR(ndst); 2454 2447 dst_release(ndst);
+1 -1
include/linux/bpf.h
··· 216 216 u64 bpf_get_stackid(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5); 217 217 218 218 bool bpf_prog_array_compatible(struct bpf_array *array, const struct bpf_prog *fp); 219 - int bpf_prog_calc_digest(struct bpf_prog *fp); 219 + int bpf_prog_calc_tag(struct bpf_prog *fp); 220 220 221 221 const struct bpf_func_proto *bpf_get_trace_printk_proto(void); 222 222
+4 -2
include/linux/filter.h
··· 57 57 /* BPF program can access up to 512 bytes of stack space. */ 58 58 #define MAX_BPF_STACK 512 59 59 60 + #define BPF_TAG_SIZE 8 61 + 60 62 /* Helper macros for filter block array initializers. */ 61 63 62 64 /* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */ ··· 410 408 kmemcheck_bitfield_end(meta); 411 409 enum bpf_prog_type type; /* Type of BPF program */ 412 410 u32 len; /* Number of filter blocks */ 413 - u32 digest[SHA_DIGEST_WORDS]; /* Program digest */ 411 + u8 tag[BPF_TAG_SIZE]; 414 412 struct bpf_prog_aux *aux; /* Auxiliary fields */ 415 413 struct sock_fprog_kern *orig_prog; /* Original BPF program */ 416 414 unsigned int (*bpf_func)(const void *ctx, ··· 521 519 return prog->len * sizeof(struct bpf_insn); 522 520 } 523 521 524 - static inline u32 bpf_prog_digest_scratch_size(const struct bpf_prog *prog) 522 + static inline u32 bpf_prog_tag_scratch_size(const struct bpf_prog *prog) 525 523 { 526 524 return round_up(bpf_prog_insn_size(prog) + 527 525 sizeof(__be64) + 1, SHA_MESSAGE_BYTES);
+6 -1
include/linux/tcp.h
··· 62 62 63 63 /* TCP Fast Open Cookie as stored in memory */ 64 64 struct tcp_fastopen_cookie { 65 + union { 66 + u8 val[TCP_FASTOPEN_COOKIE_MAX]; 67 + #if IS_ENABLED(CONFIG_IPV6) 68 + struct in6_addr addr; 69 + #endif 70 + }; 65 71 s8 len; 66 - u8 val[TCP_FASTOPEN_COOKIE_MAX]; 67 72 bool exp; /* In RFC6994 experimental option format */ 68 73 }; 69 74
+3 -1
include/uapi/linux/nl80211.h
··· 1772 1772 * 1773 1773 * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode 1774 1774 * Notification Element based on association request when used with 1775 - * %NL80211_CMD_NEW_STATION; u8 attribute. 1775 + * %NL80211_CMD_NEW_STATION or %NL80211_CMD_SET_STATION (only when 1776 + * %NL80211_FEATURE_FULL_AP_CLIENT_STATE is supported, or with TDLS); 1777 + * u8 attribute. 1776 1778 * 1777 1779 * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if 1778 1780 * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
+1 -1
include/uapi/linux/pkt_cls.h
··· 397 397 TCA_BPF_NAME, 398 398 TCA_BPF_FLAGS, 399 399 TCA_BPF_FLAGS_GEN, 400 - TCA_BPF_DIGEST, 400 + TCA_BPF_TAG, 401 401 __TCA_BPF_MAX, 402 402 }; 403 403
+1 -1
include/uapi/linux/tc_act/tc_bpf.h
··· 27 27 TCA_ACT_BPF_FD, 28 28 TCA_ACT_BPF_NAME, 29 29 TCA_ACT_BPF_PAD, 30 - TCA_ACT_BPF_DIGEST, 30 + TCA_ACT_BPF_TAG, 31 31 __TCA_ACT_BPF_MAX, 32 32 }; 33 33 #define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1)
+8 -6
kernel/bpf/core.c
··· 146 146 vfree(fp); 147 147 } 148 148 149 - int bpf_prog_calc_digest(struct bpf_prog *fp) 149 + int bpf_prog_calc_tag(struct bpf_prog *fp) 150 150 { 151 151 const u32 bits_offset = SHA_MESSAGE_BYTES - sizeof(__be64); 152 - u32 raw_size = bpf_prog_digest_scratch_size(fp); 152 + u32 raw_size = bpf_prog_tag_scratch_size(fp); 153 + u32 digest[SHA_DIGEST_WORDS]; 153 154 u32 ws[SHA_WORKSPACE_WORDS]; 154 155 u32 i, bsize, psize, blocks; 155 156 struct bpf_insn *dst; ··· 163 162 if (!raw) 164 163 return -ENOMEM; 165 164 166 - sha_init(fp->digest); 165 + sha_init(digest); 167 166 memset(ws, 0, sizeof(ws)); 168 167 169 168 /* We need to take out the map fd for the digest calculation ··· 205 204 *bits = cpu_to_be64((psize - 1) << 3); 206 205 207 206 while (blocks--) { 208 - sha_transform(fp->digest, todo, ws); 207 + sha_transform(digest, todo, ws); 209 208 todo += SHA_MESSAGE_BYTES; 210 209 } 211 210 212 - result = (__force __be32 *)fp->digest; 211 + result = (__force __be32 *)digest; 213 212 for (i = 0; i < SHA_DIGEST_WORDS; i++) 214 - result[i] = cpu_to_be32(fp->digest[i]); 213 + result[i] = cpu_to_be32(digest[i]); 214 + memcpy(fp->tag, result, sizeof(fp->tag)); 215 215 216 216 vfree(raw); 217 217 return 0;
+4 -4
kernel/bpf/syscall.c
··· 688 688 static void bpf_prog_show_fdinfo(struct seq_file *m, struct file *filp) 689 689 { 690 690 const struct bpf_prog *prog = filp->private_data; 691 - char prog_digest[sizeof(prog->digest) * 2 + 1] = { }; 691 + char prog_tag[sizeof(prog->tag) * 2 + 1] = { }; 692 692 693 - bin2hex(prog_digest, prog->digest, sizeof(prog->digest)); 693 + bin2hex(prog_tag, prog->tag, sizeof(prog->tag)); 694 694 seq_printf(m, 695 695 "prog_type:\t%u\n" 696 696 "prog_jited:\t%u\n" 697 - "prog_digest:\t%s\n" 697 + "prog_tag:\t%s\n" 698 698 "memlock:\t%llu\n", 699 699 prog->type, 700 700 prog->jited, 701 - prog_digest, 701 + prog_tag, 702 702 prog->pages * 1ULL << PAGE_SHIFT); 703 703 } 704 704 #endif
+1 -1
kernel/bpf/verifier.c
··· 2936 2936 int insn_cnt = env->prog->len; 2937 2937 int i, j, err; 2938 2938 2939 - err = bpf_prog_calc_digest(env->prog); 2939 + err = bpf_prog_calc_tag(env->prog); 2940 2940 if (err) 2941 2941 return err; 2942 2942
+1 -1
net/ax25/ax25_subr.c
··· 264 264 { 265 265 ax25_clear_queues(ax25); 266 266 267 - if (!sock_flag(ax25->sk, SOCK_DESTROY)) 267 + if (!ax25->sk || !sock_flag(ax25->sk, SOCK_DESTROY)) 268 268 ax25_stop_heartbeat(ax25); 269 269 ax25_stop_t1timer(ax25); 270 270 ax25_stop_t2timer(ax25);
+7 -4
net/ipv4/fib_semantics.c
··· 1279 1279 nla_put_u32(skb, RTA_FLOW, fi->fib_nh[0].nh_tclassid)) 1280 1280 goto nla_put_failure; 1281 1281 #endif 1282 - if (fi->fib_nh->nh_lwtstate) 1283 - lwtunnel_fill_encap(skb, fi->fib_nh->nh_lwtstate); 1282 + if (fi->fib_nh->nh_lwtstate && 1283 + lwtunnel_fill_encap(skb, fi->fib_nh->nh_lwtstate) < 0) 1284 + goto nla_put_failure; 1284 1285 } 1285 1286 #ifdef CONFIG_IP_ROUTE_MULTIPATH 1286 1287 if (fi->fib_nhs > 1) { ··· 1317 1316 nla_put_u32(skb, RTA_FLOW, nh->nh_tclassid)) 1318 1317 goto nla_put_failure; 1319 1318 #endif 1320 - if (nh->nh_lwtstate) 1321 - lwtunnel_fill_encap(skb, nh->nh_lwtstate); 1319 + if (nh->nh_lwtstate && 1320 + lwtunnel_fill_encap(skb, nh->nh_lwtstate) < 0) 1321 + goto nla_put_failure; 1322 + 1322 1323 /* length of rtnetlink header + attributes */ 1323 1324 rtnh->rtnh_len = nlmsg_get_pos(skb) - (void *) rtnh; 1324 1325 } endfor_nexthops(fi);
+1 -1
net/ipv4/route.c
··· 2472 2472 r->rtm_dst_len = 32; 2473 2473 r->rtm_src_len = 0; 2474 2474 r->rtm_tos = fl4->flowi4_tos; 2475 - r->rtm_table = table_id; 2475 + r->rtm_table = table_id < 256 ? table_id : RT_TABLE_COMPAT; 2476 2476 if (nla_put_u32(skb, RTA_TABLE, table_id)) 2477 2477 goto nla_put_failure; 2478 2478 r->rtm_type = rt->rt_type;
+1 -1
net/ipv4/tcp_fastopen.c
··· 113 113 struct tcp_fastopen_cookie tmp; 114 114 115 115 if (__tcp_fastopen_cookie_gen(&ip6h->saddr, &tmp)) { 116 - struct in6_addr *buf = (struct in6_addr *) tmp.val; 116 + struct in6_addr *buf = &tmp.addr; 117 117 int i; 118 118 119 119 for (i = 0; i < 4; i++)
+2 -2
net/ipv6/ip6_tunnel.c
··· 1108 1108 t->parms.name); 1109 1109 goto tx_err_dst_release; 1110 1110 } 1111 - mtu = dst_mtu(dst) - psh_hlen; 1111 + mtu = dst_mtu(dst) - psh_hlen - t->tun_hlen; 1112 1112 if (encap_limit >= 0) { 1113 1113 max_headroom += 8; 1114 1114 mtu -= 8; ··· 1117 1117 mtu = IPV6_MIN_MTU; 1118 1118 if (skb_dst(skb) && !t->parms.collect_md) 1119 1119 skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu); 1120 - if (skb->len > mtu && !skb_is_gso(skb)) { 1120 + if (skb->len - t->tun_hlen > mtu && !skb_is_gso(skb)) { 1121 1121 *pmtu = mtu; 1122 1122 err = -EMSGSIZE; 1123 1123 goto tx_err_dst_release;
+30 -21
net/ipv6/mcast.c
··· 81 81 static void mld_ifc_timer_expire(unsigned long data); 82 82 static void mld_ifc_event(struct inet6_dev *idev); 83 83 static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *pmc); 84 - static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *addr); 84 + static void mld_del_delrec(struct inet6_dev *idev, struct ifmcaddr6 *pmc); 85 85 static void mld_clear_delrec(struct inet6_dev *idev); 86 86 static bool mld_in_v1_mode(const struct inet6_dev *idev); 87 87 static int sf_setstate(struct ifmcaddr6 *pmc); ··· 692 692 dev_mc_del(dev, buf); 693 693 } 694 694 695 - if (mc->mca_flags & MAF_NOREPORT) 696 - goto done; 697 695 spin_unlock_bh(&mc->mca_lock); 696 + if (mc->mca_flags & MAF_NOREPORT) 697 + return; 698 698 699 699 if (!mc->idev->dead) 700 700 igmp6_leave_group(mc); ··· 702 702 spin_lock_bh(&mc->mca_lock); 703 703 if (del_timer(&mc->mca_timer)) 704 704 atomic_dec(&mc->mca_refcnt); 705 - done: 706 - ip6_mc_clear_src(mc); 707 705 spin_unlock_bh(&mc->mca_lock); 708 706 } 709 707 ··· 746 748 spin_unlock_bh(&idev->mc_lock); 747 749 } 748 750 749 - static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *pmca) 751 + static void mld_del_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im) 750 752 { 751 753 struct ifmcaddr6 *pmc, *pmc_prev; 752 - struct ip6_sf_list *psf, *psf_next; 754 + struct ip6_sf_list *psf; 755 + struct in6_addr *pmca = &im->mca_addr; 753 756 754 757 spin_lock_bh(&idev->mc_lock); 755 758 pmc_prev = NULL; ··· 767 768 } 768 769 spin_unlock_bh(&idev->mc_lock); 769 770 771 + spin_lock_bh(&im->mca_lock); 770 772 if (pmc) { 771 - for (psf = pmc->mca_tomb; psf; psf = psf_next) { 772 - psf_next = psf->sf_next; 773 - kfree(psf); 773 + im->idev = pmc->idev; 774 + im->mca_crcount = idev->mc_qrv; 775 + im->mca_sfmode = pmc->mca_sfmode; 776 + if (pmc->mca_sfmode == MCAST_INCLUDE) { 777 + im->mca_tomb = pmc->mca_tomb; 778 + im->mca_sources = pmc->mca_sources; 779 + for (psf = im->mca_sources; psf; psf = psf->sf_next) 780 + psf->sf_crcount = im->mca_crcount; 774 781 } 775 782 in6_dev_put(pmc->idev); 776 - kfree(pmc); 777 783 } 784 + spin_unlock_bh(&im->mca_lock); 778 785 } 779 786 780 787 static void mld_clear_delrec(struct inet6_dev *idev) ··· 909 904 mca_get(mc); 910 905 write_unlock_bh(&idev->lock); 911 906 912 - mld_del_delrec(idev, &mc->mca_addr); 907 + mld_del_delrec(idev, mc); 913 908 igmp6_group_added(mc); 914 909 ma_put(mc); 915 910 return 0; ··· 932 927 write_unlock_bh(&idev->lock); 933 928 934 929 igmp6_group_dropped(ma); 930 + ip6_mc_clear_src(ma); 935 931 936 932 ma_put(ma); 937 933 return 0; ··· 2507 2501 /* Withdraw multicast list */ 2508 2502 2509 2503 read_lock_bh(&idev->lock); 2510 - mld_ifc_stop_timer(idev); 2511 - mld_gq_stop_timer(idev); 2512 - mld_dad_stop_timer(idev); 2513 2504 2514 2505 for (i = idev->mc_list; i; i = i->next) 2515 2506 igmp6_group_dropped(i); 2516 - read_unlock_bh(&idev->lock); 2517 2507 2518 - mld_clear_delrec(idev); 2508 + /* Should stop timer after group drop. or we will 2509 + * start timer again in mld_ifc_event() 2510 + */ 2511 + mld_ifc_stop_timer(idev); 2512 + mld_gq_stop_timer(idev); 2513 + mld_dad_stop_timer(idev); 2514 + read_unlock_bh(&idev->lock); 2519 2515 } 2520 2516 2521 2517 static void ipv6_mc_reset(struct inet6_dev *idev) ··· 2539 2531 2540 2532 read_lock_bh(&idev->lock); 2541 2533 ipv6_mc_reset(idev); 2542 - for (i = idev->mc_list; i; i = i->next) 2534 + for (i = idev->mc_list; i; i = i->next) { 2535 + mld_del_delrec(idev, i); 2543 2536 igmp6_group_added(i); 2537 + } 2544 2538 read_unlock_bh(&idev->lock); 2545 2539 } 2546 2540 ··· 2575 2565 2576 2566 /* Deactivate timers */ 2577 2567 ipv6_mc_down(idev); 2568 + mld_clear_delrec(idev); 2578 2569 2579 2570 /* Delete all-nodes address. */ 2580 2571 /* We cannot call ipv6_dev_mc_dec() directly, our caller in ··· 2590 2579 write_lock_bh(&idev->lock); 2591 2580 while ((i = idev->mc_list) != NULL) { 2592 2581 idev->mc_list = i->next; 2582 + 2593 2583 write_unlock_bh(&idev->lock); 2594 - 2595 - igmp6_group_dropped(i); 2596 2584 ma_put(i); 2597 - 2598 2585 write_lock_bh(&idev->lock); 2599 2586 } 2600 2587 write_unlock_bh(&idev->lock);
+2 -1
net/ipv6/route.c
··· 3317 3317 if (nla_put_u8(skb, RTA_PREF, IPV6_EXTRACT_PREF(rt->rt6i_flags))) 3318 3318 goto nla_put_failure; 3319 3319 3320 - lwtunnel_fill_encap(skb, rt->dst.lwtstate); 3320 + if (lwtunnel_fill_encap(skb, rt->dst.lwtstate) < 0) 3321 + goto nla_put_failure; 3321 3322 3322 3323 nlmsg_end(skb, nlh); 3323 3324 return 0;
+1 -1
net/ipv6/seg6_hmac.c
··· 400 400 *p_tfm = tfm; 401 401 } 402 402 403 - p_tfm = this_cpu_ptr(algo->tfms); 403 + p_tfm = raw_cpu_ptr(algo->tfms); 404 404 tfm = *p_tfm; 405 405 406 406 shsize = sizeof(*shash) + crypto_shash_descsize(tfm);
+4
net/ipv6/seg6_iptunnel.c
··· 265 265 slwt = seg6_lwt_lwtunnel(orig_dst->lwtstate); 266 266 267 267 #ifdef CONFIG_DST_CACHE 268 + preempt_disable(); 268 269 dst = dst_cache_get(&slwt->cache); 270 + preempt_enable(); 269 271 #endif 270 272 271 273 if (unlikely(!dst)) { ··· 288 286 } 289 287 290 288 #ifdef CONFIG_DST_CACHE 289 + preempt_disable(); 291 290 dst_cache_set_ip6(&slwt->cache, dst, &fl6.saddr); 291 + preempt_enable(); 292 292 #endif 293 293 } 294 294
-3
net/mac80211/chan.c
··· 231 231 !(sta->sdata->bss && sta->sdata->bss == sdata->bss)) 232 232 continue; 233 233 234 - if (!sta->uploaded || !test_sta_flag(sta, WLAN_STA_ASSOC)) 235 - continue; 236 - 237 234 max_bw = max(max_bw, ieee80211_get_sta_bw(&sta->sta)); 238 235 } 239 236 rcu_read_unlock();
+21
net/mac80211/iface.c
··· 6 6 * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz> 7 7 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net> 8 8 * Copyright 2013-2014 Intel Mobile Communications GmbH 9 + * Copyright (c) 2016 Intel Deutschland GmbH 9 10 * 10 11 * This program is free software; you can redistribute it and/or modify 11 12 * it under the terms of the GNU General Public License version 2 as ··· 1296 1295 } else if (ieee80211_is_action(mgmt->frame_control) && 1297 1296 mgmt->u.action.category == WLAN_CATEGORY_VHT) { 1298 1297 switch (mgmt->u.action.u.vht_group_notif.action_code) { 1298 + case WLAN_VHT_ACTION_OPMODE_NOTIF: { 1299 + struct ieee80211_rx_status *status; 1300 + enum nl80211_band band; 1301 + u8 opmode; 1302 + 1303 + status = IEEE80211_SKB_RXCB(skb); 1304 + band = status->band; 1305 + opmode = mgmt->u.action.u.vht_opmode_notif.operating_mode; 1306 + 1307 + mutex_lock(&local->sta_mtx); 1308 + sta = sta_info_get_bss(sdata, mgmt->sa); 1309 + 1310 + if (sta) 1311 + ieee80211_vht_handle_opmode(sdata, sta, 1312 + opmode, 1313 + band); 1314 + 1315 + mutex_unlock(&local->sta_mtx); 1316 + break; 1317 + } 1299 1318 case WLAN_VHT_ACTION_GROUPID_MGMT: 1300 1319 ieee80211_process_mu_groups(sdata, mgmt); 1301 1320 break;
+9 -4
net/mac80211/main.c
··· 913 913 supp_ht = supp_ht || sband->ht_cap.ht_supported; 914 914 supp_vht = supp_vht || sband->vht_cap.vht_supported; 915 915 916 - if (sband->ht_cap.ht_supported) 917 - local->rx_chains = 918 - max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs), 919 - local->rx_chains); 916 + if (!sband->ht_cap.ht_supported) 917 + continue; 920 918 921 919 /* TODO: consider VHT for RX chains, hopefully it's the same */ 920 + local->rx_chains = 921 + max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs), 922 + local->rx_chains); 923 + 924 + /* no need to mask, SM_PS_DISABLED has all bits set */ 925 + sband->ht_cap.cap |= WLAN_HT_CAP_SM_PS_DISABLED << 926 + IEEE80211_HT_CAP_SM_PS_SHIFT; 922 927 } 923 928 924 929 /* if low-level driver supports AP, we also support VLAN */
+2
net/mac80211/rate.c
··· 40 40 41 41 ieee80211_sta_set_rx_nss(sta); 42 42 43 + ieee80211_recalc_min_chandef(sta->sdata); 44 + 43 45 if (!ref) 44 46 return; 45 47
+21 -17
net/mac80211/rx.c
··· 2472 2472 if (!ifmsh->mshcfg.dot11MeshForwarding) 2473 2473 goto out; 2474 2474 2475 - fwd_skb = skb_copy_expand(skb, local->tx_headroom, 0, GFP_ATOMIC); 2475 + fwd_skb = skb_copy_expand(skb, local->tx_headroom + 2476 + sdata->encrypt_headroom, 0, GFP_ATOMIC); 2476 2477 if (!fwd_skb) { 2477 2478 net_info_ratelimited("%s: failed to clone mesh frame\n", 2478 2479 sdata->name); ··· 2881 2880 2882 2881 switch (mgmt->u.action.u.vht_opmode_notif.action_code) { 2883 2882 case WLAN_VHT_ACTION_OPMODE_NOTIF: { 2884 - u8 opmode; 2885 - 2886 2883 /* verify opmode is present */ 2887 2884 if (len < IEEE80211_MIN_ACTION_SIZE + 2) 2888 2885 goto invalid; 2889 - 2890 - opmode = mgmt->u.action.u.vht_opmode_notif.operating_mode; 2891 - 2892 - ieee80211_vht_handle_opmode(rx->sdata, rx->sta, 2893 - opmode, status->band); 2894 - goto handled; 2886 + goto queue; 2895 2887 } 2896 2888 case WLAN_VHT_ACTION_GROUPID_MGMT: { 2897 2889 if (len < IEEE80211_MIN_ACTION_SIZE + 25) ··· 3936 3942 u64_stats_update_end(&stats->syncp); 3937 3943 3938 3944 if (fast_rx->internal_forward) { 3939 - struct sta_info *dsta = sta_info_get(rx->sdata, skb->data); 3945 + struct sk_buff *xmit_skb = NULL; 3946 + bool multicast = is_multicast_ether_addr(skb->data); 3940 3947 3941 - if (dsta) { 3948 + if (multicast) { 3949 + xmit_skb = skb_copy(skb, GFP_ATOMIC); 3950 + } else if (sta_info_get(rx->sdata, skb->data)) { 3951 + xmit_skb = skb; 3952 + skb = NULL; 3953 + } 3954 + 3955 + if (xmit_skb) { 3942 3956 /* 3943 3957 * Send to wireless media and increase priority by 256 3944 3958 * to keep the received priority instead of 3945 3959 * reclassifying the frame (see cfg80211_classify8021d). 3946 3960 */ 3947 - skb->priority += 256; 3948 - skb->protocol = htons(ETH_P_802_3); 3949 - skb_reset_network_header(skb); 3950 - skb_reset_mac_header(skb); 3951 - dev_queue_xmit(skb); 3952 - return true; 3961 + xmit_skb->priority += 256; 3962 + xmit_skb->protocol = htons(ETH_P_802_3); 3963 + skb_reset_network_header(xmit_skb); 3964 + skb_reset_mac_header(xmit_skb); 3965 + dev_queue_xmit(xmit_skb); 3953 3966 } 3967 + 3968 + if (!skb) 3969 + return true; 3954 3970 } 3955 3971 3956 3972 /* deliver to local stack */
+2 -2
net/mac80211/sta_info.c
··· 1501 1501 1502 1502 /* This will evaluate to 1, 3, 5 or 7. */ 1503 1503 for (ac = IEEE80211_AC_VO; ac < IEEE80211_NUM_ACS; ac++) 1504 - if (ignored_acs & BIT(ac)) 1505 - continue; 1504 + if (!(ignored_acs & ieee80211_ac_to_qos_mask[ac])) 1505 + break; 1506 1506 tid = 7 - 2 * ac; 1507 1507 1508 1508 ieee80211_send_null_response(sta, tid, reason, true, false);
+7 -10
net/mac80211/tx.c
··· 1243 1243 1244 1244 static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local, 1245 1245 struct ieee80211_vif *vif, 1246 - struct ieee80211_sta *pubsta, 1246 + struct sta_info *sta, 1247 1247 struct sk_buff *skb) 1248 1248 { 1249 1249 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; ··· 1257 1257 if (!ieee80211_is_data(hdr->frame_control)) 1258 1258 return NULL; 1259 1259 1260 - if (pubsta) { 1260 + if (sta) { 1261 1261 u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; 1262 1262 1263 - txq = pubsta->txq[tid]; 1263 + if (!sta->uploaded) 1264 + return NULL; 1265 + 1266 + txq = sta->sta.txq[tid]; 1264 1267 } else if (vif) { 1265 1268 txq = vif->txq; 1266 1269 } ··· 1506 1503 struct fq *fq = &local->fq; 1507 1504 struct ieee80211_vif *vif; 1508 1505 struct txq_info *txqi; 1509 - struct ieee80211_sta *pubsta; 1510 1506 1511 1507 if (!local->ops->wake_tx_queue || 1512 1508 sdata->vif.type == NL80211_IFTYPE_MONITOR) 1513 1509 return false; 1514 - 1515 - if (sta && sta->uploaded) 1516 - pubsta = &sta->sta; 1517 - else 1518 - pubsta = NULL; 1519 1510 1520 1511 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 1521 1512 sdata = container_of(sdata->bss, 1522 1513 struct ieee80211_sub_if_data, u.ap); 1523 1514 1524 1515 vif = &sdata->vif; 1525 - txqi = ieee80211_get_txq(local, vif, pubsta, skb); 1516 + txqi = ieee80211_get_txq(local, vif, sta, skb); 1526 1517 1527 1518 if (!txqi) 1528 1519 return false;
+3 -1
net/mac80211/vht.c
··· 527 527 528 528 u32 changed = __ieee80211_vht_handle_opmode(sdata, sta, opmode, band); 529 529 530 - if (changed > 0) 530 + if (changed > 0) { 531 + ieee80211_recalc_min_chandef(sdata); 531 532 rate_control_rate_update(local, sband, sta, changed); 533 + } 532 534 } 533 535 534 536 void ieee80211_get_vht_mask_from_cap(__le16 vht_cap,
+4 -2
net/openvswitch/conntrack.c
··· 514 514 int hooknum, nh_off, err = NF_ACCEPT; 515 515 516 516 nh_off = skb_network_offset(skb); 517 - skb_pull(skb, nh_off); 517 + skb_pull_rcsum(skb, nh_off); 518 518 519 519 /* See HOOK2MANIP(). */ 520 520 if (maniptype == NF_NAT_MANIP_SRC) ··· 579 579 err = nf_nat_packet(ct, ctinfo, hooknum, skb); 580 580 push: 581 581 skb_push(skb, nh_off); 582 + skb_postpush_rcsum(skb, skb->data, nh_off); 582 583 583 584 return err; 584 585 } ··· 887 886 888 887 /* The conntrack module expects to be working at L3. */ 889 888 nh_ofs = skb_network_offset(skb); 890 - skb_pull(skb, nh_ofs); 889 + skb_pull_rcsum(skb, nh_ofs); 891 890 892 891 if (key->ip.frag != OVS_FRAG_TYPE_NONE) { 893 892 err = handle_fragments(net, key, info->zone.id, skb); ··· 901 900 err = ovs_ct_lookup(net, key, info, skb); 902 901 903 902 skb_push(skb, nh_ofs); 903 + skb_postpush_rcsum(skb, skb->data, nh_ofs); 904 904 if (err) 905 905 kfree_skb(skb); 906 906 return err;
+2 -3
net/sched/act_api.c
··· 900 900 goto err; 901 901 } 902 902 act->order = i; 903 - if (event == RTM_GETACTION) 904 - act->tcfa_refcnt++; 905 903 list_add_tail(&act->list, &actions); 906 904 } 907 905 ··· 912 914 return ret; 913 915 } 914 916 err: 915 - tcf_action_destroy(&actions, 0); 917 + if (event != RTM_GETACTION) 918 + tcf_action_destroy(&actions, 0); 916 919 return ret; 917 920 } 918 921
+2 -3
net/sched/act_bpf.c
··· 123 123 nla_put_string(skb, TCA_ACT_BPF_NAME, prog->bpf_name)) 124 124 return -EMSGSIZE; 125 125 126 - nla = nla_reserve(skb, TCA_ACT_BPF_DIGEST, 127 - sizeof(prog->filter->digest)); 126 + nla = nla_reserve(skb, TCA_ACT_BPF_TAG, sizeof(prog->filter->tag)); 128 127 if (nla == NULL) 129 128 return -EMSGSIZE; 130 129 131 - memcpy(nla_data(nla), prog->filter->digest, nla_len(nla)); 130 + memcpy(nla_data(nla), prog->filter->tag, nla_len(nla)); 132 131 133 132 return 0; 134 133 }
+2 -2
net/sched/cls_bpf.c
··· 555 555 nla_put_string(skb, TCA_BPF_NAME, prog->bpf_name)) 556 556 return -EMSGSIZE; 557 557 558 - nla = nla_reserve(skb, TCA_BPF_DIGEST, sizeof(prog->filter->digest)); 558 + nla = nla_reserve(skb, TCA_BPF_TAG, sizeof(prog->filter->tag)); 559 559 if (nla == NULL) 560 560 return -EMSGSIZE; 561 561 562 - memcpy(nla_data(nla), prog->filter->digest, nla_len(nla)); 562 + memcpy(nla_data(nla), prog->filter->tag, nla_len(nla)); 563 563 564 564 return 0; 565 565 }
+2 -2
net/tipc/discover.c
··· 169 169 170 170 /* Send response, if necessary */ 171 171 if (respond && (mtyp == DSC_REQ_MSG)) { 172 - rskb = tipc_buf_acquire(MAX_H_SIZE); 172 + rskb = tipc_buf_acquire(MAX_H_SIZE, GFP_ATOMIC); 173 173 if (!rskb) 174 174 return; 175 175 tipc_disc_init_msg(net, rskb, DSC_RESP_MSG, bearer); ··· 278 278 req = kmalloc(sizeof(*req), GFP_ATOMIC); 279 279 if (!req) 280 280 return -ENOMEM; 281 - req->buf = tipc_buf_acquire(MAX_H_SIZE); 281 + req->buf = tipc_buf_acquire(MAX_H_SIZE, GFP_ATOMIC); 282 282 if (!req->buf) { 283 283 kfree(req); 284 284 return -ENOMEM;
+1 -1
net/tipc/link.c
··· 1395 1395 msg_set_seqno(hdr, seqno++); 1396 1396 pktlen = msg_size(hdr); 1397 1397 msg_set_size(&tnlhdr, pktlen + INT_H_SIZE); 1398 - tnlskb = tipc_buf_acquire(pktlen + INT_H_SIZE); 1398 + tnlskb = tipc_buf_acquire(pktlen + INT_H_SIZE, GFP_ATOMIC); 1399 1399 if (!tnlskb) { 1400 1400 pr_warn("%sunable to send packet\n", link_co_err); 1401 1401 return;
+8 -8
net/tipc/msg.c
··· 58 58 * NOTE: Headroom is reserved to allow prepending of a data link header. 59 59 * There may also be unrequested tailroom present at the buffer's end. 60 60 */ 61 - struct sk_buff *tipc_buf_acquire(u32 size) 61 + struct sk_buff *tipc_buf_acquire(u32 size, gfp_t gfp) 62 62 { 63 63 struct sk_buff *skb; 64 64 unsigned int buf_size = (BUF_HEADROOM + size + 3) & ~3u; 65 65 66 - skb = alloc_skb_fclone(buf_size, GFP_ATOMIC); 66 + skb = alloc_skb_fclone(buf_size, gfp); 67 67 if (skb) { 68 68 skb_reserve(skb, BUF_HEADROOM); 69 69 skb_put(skb, size); ··· 95 95 struct tipc_msg *msg; 96 96 struct sk_buff *buf; 97 97 98 - buf = tipc_buf_acquire(hdr_sz + data_sz); 98 + buf = tipc_buf_acquire(hdr_sz + data_sz, GFP_ATOMIC); 99 99 if (unlikely(!buf)) 100 100 return NULL; 101 101 ··· 261 261 262 262 /* No fragmentation needed? */ 263 263 if (likely(msz <= pktmax)) { 264 - skb = tipc_buf_acquire(msz); 264 + skb = tipc_buf_acquire(msz, GFP_KERNEL); 265 265 if (unlikely(!skb)) 266 266 return -ENOMEM; 267 267 skb_orphan(skb); ··· 282 282 msg_set_importance(&pkthdr, msg_importance(mhdr)); 283 283 284 284 /* Prepare first fragment */ 285 - skb = tipc_buf_acquire(pktmax); 285 + skb = tipc_buf_acquire(pktmax, GFP_KERNEL); 286 286 if (!skb) 287 287 return -ENOMEM; 288 288 skb_orphan(skb); ··· 313 313 pktsz = drem + INT_H_SIZE; 314 314 else 315 315 pktsz = pktmax; 316 - skb = tipc_buf_acquire(pktsz); 316 + skb = tipc_buf_acquire(pktsz, GFP_KERNEL); 317 317 if (!skb) { 318 318 rc = -ENOMEM; 319 319 goto error; ··· 448 448 if (msz > (max / 2)) 449 449 return false; 450 450 451 - _skb = tipc_buf_acquire(max); 451 + _skb = tipc_buf_acquire(max, GFP_ATOMIC); 452 452 if (!_skb) 453 453 return false; 454 454 ··· 496 496 497 497 /* Never return SHORT header; expand by replacing buffer if necessary */ 498 498 if (msg_short(hdr)) { 499 - *skb = tipc_buf_acquire(BASIC_H_SIZE + dlen); 499 + *skb = tipc_buf_acquire(BASIC_H_SIZE + dlen, GFP_ATOMIC); 500 500 if (!*skb) 501 501 goto exit; 502 502 memcpy((*skb)->data + BASIC_H_SIZE, msg_data(hdr), dlen);
+1 -1
net/tipc/msg.h
··· 820 820 return (msg_user(hdr) == LINK_PROTOCOL) && (msg_type(hdr) == RESET_MSG); 821 821 } 822 822 823 - struct sk_buff *tipc_buf_acquire(u32 size); 823 + struct sk_buff *tipc_buf_acquire(u32 size, gfp_t gfp); 824 824 bool tipc_msg_validate(struct sk_buff *skb); 825 825 bool tipc_msg_reverse(u32 own_addr, struct sk_buff **skb, int err); 826 826 void tipc_msg_init(u32 own_addr, struct tipc_msg *m, u32 user, u32 type,
+1 -1
net/tipc/name_distr.c
··· 69 69 u32 dest) 70 70 { 71 71 struct tipc_net *tn = net_generic(net, tipc_net_id); 72 - struct sk_buff *buf = tipc_buf_acquire(INT_H_SIZE + size); 72 + struct sk_buff *buf = tipc_buf_acquire(INT_H_SIZE + size, GFP_ATOMIC); 73 73 struct tipc_msg *msg; 74 74 75 75 if (buf != NULL) {
+15
net/wireless/nl80211.c
··· 4615 4615 break; 4616 4616 } 4617 4617 4618 + /* 4619 + * Older kernel versions ignored this attribute entirely, so don't 4620 + * reject attempts to update it but mark it as unused instead so the 4621 + * driver won't look at the data. 4622 + */ 4623 + if (statype != CFG80211_STA_AP_CLIENT_UNASSOC && 4624 + statype != CFG80211_STA_TDLS_PEER_SETUP) 4625 + params->opmode_notif_used = false; 4626 + 4618 4627 return 0; 4619 4628 } 4620 4629 EXPORT_SYMBOL(cfg80211_check_station_change); ··· 4861 4852 return -EINVAL; 4862 4853 4863 4854 params.local_pm = pm; 4855 + } 4856 + 4857 + if (info->attrs[NL80211_ATTR_OPMODE_NOTIF]) { 4858 + params.opmode_notif_used = true; 4859 + params.opmode_notif = 4860 + nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]); 4864 4861 } 4865 4862 4866 4863 /* Include parameters for TDLS peer (will check later) */