Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ba3ebff authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull networking fixes from David Miller:
 "Hopefully this is the last batch of networking fixes for 4.14

  Fingers crossed...

   1) Fix stmmac to use the proper sized OF property read, from Bhadram
      Varka.

   2) Fix use after free in net scheduler tc action code, from Cong
      Wang.

   3) Fix SKB control block mangling in tcp_make_synack().

   4) Use proper locking in fib_dump_info(), from Florian Westphal.

   5) Fix IPG encodings in systemport driver, from Florian Fainelli.

   6) Fix division by zero in NV TCP congestion control module, from
      Konstantin Khlebnikov.

   7) Fix use after free in nf_reject_ipv4, from Tejaswi Tanikella"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  net: systemport: Correct IPG length settings
  tcp: do not mangle skb->cb[] in tcp_make_synack()
  fib: fib_dump_info can no longer use __in_dev_get_rtnl
  stmmac: use of_property_read_u32 instead of read_u8
  net_sched: hold netns refcnt for each action
  net_sched: acquire RTNL in tc_action_net_exit()
  net: vrf: correct FRA_L3MDEV encode type
  tcp_nv: fix division by zero in tcpnv_acked()
  netfilter: nf_reject_ipv4: Fix use-after-free in send_reset
  netfilter: nft_set_hash: disable fast_ops for 2-len keys
parents f0395d5b 93824c80
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1809,15 +1809,17 @@ static inline void bcm_sysport_mask_all_intrs(struct bcm_sysport_priv *priv)

static inline void gib_set_pad_extension(struct bcm_sysport_priv *priv)
{
	u32 __maybe_unused reg;
	u32 reg;

	/* Include Broadcom tag in pad extension */
	if (netdev_uses_dsa(priv->netdev)) {
	reg = gib_readl(priv, GIB_CONTROL);
	/* Include Broadcom tag in pad extension and fix up IPG_LENGTH */
	if (netdev_uses_dsa(priv->netdev)) {
		reg &= ~(GIB_PAD_EXTENSION_MASK << GIB_PAD_EXTENSION_SHIFT);
		reg |= ENET_BRCM_TAG_LEN << GIB_PAD_EXTENSION_SHIFT;
		gib_writel(priv, reg, GIB_CONTROL);
	}
	reg &= ~(GIB_IPG_LEN_MASK << GIB_IPG_LEN_SHIFT);
	reg |= 12 << GIB_IPG_LEN_SHIFT;
	gib_writel(priv, reg, GIB_CONTROL);
}

static int bcm_sysport_open(struct net_device *dev)
+8 −8
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
	}

	/* Processing RX queues common config */
	if (of_property_read_u8(rx_node, "snps,rx-queues-to-use",
	if (of_property_read_u32(rx_node, "snps,rx-queues-to-use",
				 &plat->rx_queues_to_use))
		plat->rx_queues_to_use = 1;

@@ -191,7 +191,7 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
		else
			plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB;

		if (of_property_read_u8(q_node, "snps,map-to-dma-channel",
		if (of_property_read_u32(q_node, "snps,map-to-dma-channel",
					 &plat->rx_queues_cfg[queue].chan))
			plat->rx_queues_cfg[queue].chan = queue;
		/* TODO: Dynamic mapping to be included in the future */
@@ -222,7 +222,7 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
	}

	/* Processing TX queues common config */
	if (of_property_read_u8(tx_node, "snps,tx-queues-to-use",
	if (of_property_read_u32(tx_node, "snps,tx-queues-to-use",
				 &plat->tx_queues_to_use))
		plat->tx_queues_to_use = 1;

@@ -244,7 +244,7 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
		if (queue >= plat->tx_queues_to_use)
			break;

		if (of_property_read_u8(q_node, "snps,weight",
		if (of_property_read_u32(q_node, "snps,weight",
					 &plat->tx_queues_cfg[queue].weight))
			plat->tx_queues_cfg[queue].weight = 0x10 + queue;

+1 −1
Original line number Diff line number Diff line
@@ -1165,7 +1165,7 @@ static int vrf_fib_rule(const struct net_device *dev, __u8 family, bool add_it)
	frh->family = family;
	frh->action = FR_ACT_TO_TBL;

	if (nla_put_u32(skb, FRA_L3MDEV, 1))
	if (nla_put_u8(skb, FRA_L3MDEV, 1))
		goto nla_put_failure;

	if (nla_put_u32(skb, FRA_PRIORITY, FIB_RULE_PREF))
+4 −4
Original line number Diff line number Diff line
@@ -126,14 +126,14 @@ struct stmmac_axi {

struct stmmac_rxq_cfg {
	u8 mode_to_use;
	u8 chan;
	u32 chan;
	u8 pkt_route;
	bool use_prio;
	u32 prio;
};

struct stmmac_txq_cfg {
	u8 weight;
	u32 weight;
	u8 mode_to_use;
	/* Credit Base Shaper parameters */
	u32 send_slope;
@@ -168,8 +168,8 @@ struct plat_stmmacenet_data {
	int unicast_filter_entries;
	int tx_fifo_size;
	int rx_fifo_size;
	u8 rx_queues_to_use;
	u8 tx_queues_to_use;
	u32 rx_queues_to_use;
	u32 tx_queues_to_use;
	u8 rx_sched_algorithm;
	u8 tx_sched_algorithm;
	struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES];
+5 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
struct tcf_idrinfo {
	spinlock_t	lock;
	struct idr	action_idr;
	struct net	*net;
};

struct tc_action_ops;
@@ -105,7 +106,7 @@ struct tc_action_net {

static inline
int tc_action_net_init(struct tc_action_net *tn,
		       const struct tc_action_ops *ops)
		       const struct tc_action_ops *ops, struct net *net)
{
	int err = 0;

@@ -113,6 +114,7 @@ int tc_action_net_init(struct tc_action_net *tn,
	if (!tn->idrinfo)
		return -ENOMEM;
	tn->ops = ops;
	tn->idrinfo->net = net;
	spin_lock_init(&tn->idrinfo->lock);
	idr_init(&tn->idrinfo->action_idr);
	return err;
@@ -123,7 +125,9 @@ void tcf_idrinfo_destroy(const struct tc_action_ops *ops,

static inline void tc_action_net_exit(struct tc_action_net *tn)
{
	rtnl_lock();
	tcf_idrinfo_destroy(tn->ops, tn->idrinfo);
	rtnl_unlock();
	kfree(tn->idrinfo);
}

Loading