Commit 3dc55dba authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull networking fixes from David Miller:

 1) Limit xt_hashlimit hash table size to avoid OOM or hung tasks, from
    Cong Wang.

 2) Fix deadlock in xsk by publishing global consumer pointers when NAPI
    is finished, from Magnus Karlsson.

 3) Set table field properly to RT_TABLE_COMPAT when necessary, from
    Jethro Beekman.

 4) NLA_STRING attributes are not necessary NULL terminated, deal wiht
    that in IFLA_ALT_IFNAME. From Eric Dumazet.

 5) Fix checksum handling in atlantic driver, from Dmitry Bezrukov.

 6) Handle mtu==0 devices properly in wireguard, from Jason A.
    Donenfeld.

 7) Fix several lockdep warnings in bonding, from Taehee Yoo.

 8) Fix cls_flower port blocking, from Jason Baron.

 9) Sanitize internal map names in libbpf, from Toke Høiland-Jørgensen.

10) Fix RDMA race in qede driver, from Michal Kalderon.

11) Fix several false lockdep warnings by adding conditions to
    list_for_each_entry_rcu(), from Madhuparna Bhowmik.

12) Fix sleep in atomic in mlx5 driver, from Huy Nguyen.

13) Fix potential deadlock in bpf_map_do_batch(), from Yonghong Song.

14) Hey, variables declared in switch statement before any case
    statements are not initialized. I learn something every day. Get
    rids of this stuff in several parts of the networking, from Kees
    Cook.

* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (99 commits)
  bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs.
  bnxt_en: Improve device shutdown method.
  net: netlink: cap max groups which will be considered in netlink_bind()
  net: thunderx: workaround BGX TX Underflow issue
  ionic: fix fw_status read
  net: disable BRIDGE_NETFILTER by default
  net: macb: Properly handle phylink on at91rm9200
  s390/qeth: fix off-by-one in RX copybreak check
  s390/qeth: don't warn for napi with 0 budget
  s390/qeth: vnicc Fix EOPNOTSUPP precedence
  openvswitch: Distribute switch variables for initialization
  net: ip6_gre: Distribute switch variables for initialization
  net: core: Distribute switch variables for initialization
  udp: rehash on disconnect
  net/tls: Fix to avoid gettig invalid tls record
  bpf: Fix a potential deadlock with bpf_map_do_batch
  bpf: Do not grab the bucket spinlock by default on htab batch ops
  ice: Wait for VF to be reset/ready before configuration
  ice: Don't tell the OS that link is going down
  ice: Don't reject odd values of usecs set by user
  ...
parents b0dd1eb2 36a44bcd
Loading
Loading
Loading
Loading
+52 −3
Original line number Original line Diff line number Diff line
@@ -3526,6 +3526,47 @@ static void bond_fold_stats(struct rtnl_link_stats64 *_res,
	}
	}
}
}


#ifdef CONFIG_LOCKDEP
static int bond_get_lowest_level_rcu(struct net_device *dev)
{
	struct net_device *ldev, *next, *now, *dev_stack[MAX_NEST_DEV + 1];
	struct list_head *niter, *iter, *iter_stack[MAX_NEST_DEV + 1];
	int cur = 0, max = 0;

	now = dev;
	iter = &dev->adj_list.lower;

	while (1) {
		next = NULL;
		while (1) {
			ldev = netdev_next_lower_dev_rcu(now, &iter);
			if (!ldev)
				break;

			next = ldev;
			niter = &ldev->adj_list.lower;
			dev_stack[cur] = now;
			iter_stack[cur++] = iter;
			if (max <= cur)
				max = cur;
			break;
		}

		if (!next) {
			if (!cur)
				return max;
			next = dev_stack[--cur];
			niter = iter_stack[cur];
		}

		now = next;
		iter = niter;
	}

	return max;
}
#endif

static void bond_get_stats(struct net_device *bond_dev,
static void bond_get_stats(struct net_device *bond_dev,
			   struct rtnl_link_stats64 *stats)
			   struct rtnl_link_stats64 *stats)
{
{
@@ -3533,11 +3574,17 @@ static void bond_get_stats(struct net_device *bond_dev,
	struct rtnl_link_stats64 temp;
	struct rtnl_link_stats64 temp;
	struct list_head *iter;
	struct list_head *iter;
	struct slave *slave;
	struct slave *slave;
	int nest_level = 0;


	spin_lock(&bond->stats_lock);
	memcpy(stats, &bond->bond_stats, sizeof(*stats));


	rcu_read_lock();
	rcu_read_lock();
#ifdef CONFIG_LOCKDEP
	nest_level = bond_get_lowest_level_rcu(bond_dev);
#endif

	spin_lock_nested(&bond->stats_lock, nest_level);
	memcpy(stats, &bond->bond_stats, sizeof(*stats));

	bond_for_each_slave_rcu(bond, slave, iter) {
	bond_for_each_slave_rcu(bond, slave, iter) {
		const struct rtnl_link_stats64 *new =
		const struct rtnl_link_stats64 *new =
			dev_get_stats(slave->dev, &temp);
			dev_get_stats(slave->dev, &temp);
@@ -3547,10 +3594,10 @@ static void bond_get_stats(struct net_device *bond_dev,
		/* save off the slave stats for the next run */
		/* save off the slave stats for the next run */
		memcpy(&slave->slave_stats, new, sizeof(*new));
		memcpy(&slave->slave_stats, new, sizeof(*new));
	}
	}
	rcu_read_unlock();


	memcpy(&bond->bond_stats, stats, sizeof(*stats));
	memcpy(&bond->bond_stats, stats, sizeof(*stats));
	spin_unlock(&bond->stats_lock);
	spin_unlock(&bond->stats_lock);
	rcu_read_unlock();
}
}


static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
@@ -3640,6 +3687,8 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
	case BOND_RELEASE_OLD:
	case BOND_RELEASE_OLD:
	case SIOCBONDRELEASE:
	case SIOCBONDRELEASE:
		res = bond_release(bond_dev, slave_dev);
		res = bond_release(bond_dev, slave_dev);
		if (!res)
			netdev_update_lockdep_key(slave_dev);
		break;
		break;
	case BOND_SETHWADDR_OLD:
	case BOND_SETHWADDR_OLD:
	case SIOCBONDSETHWADDR:
	case SIOCBONDSETHWADDR:
+2 −0
Original line number Original line Diff line number Diff line
@@ -1398,6 +1398,8 @@ static int bond_option_slaves_set(struct bonding *bond,
	case '-':
	case '-':
		slave_dbg(bond->dev, dev, "Releasing interface\n");
		slave_dbg(bond->dev, dev, "Releasing interface\n");
		ret = bond_release(bond->dev, dev);
		ret = bond_release(bond->dev, dev);
		if (!ret)
			netdev_update_lockdep_key(dev);
		break;
		break;


	default:
	default:
+3 −0
Original line number Original line Diff line number Diff line
@@ -1366,6 +1366,9 @@ void b53_vlan_add(struct dsa_switch *ds, int port,


		b53_get_vlan_entry(dev, vid, vl);
		b53_get_vlan_entry(dev, vid, vl);


		if (vid == 0 && vid == b53_default_pvid(dev))
			untagged = true;

		vl->members |= BIT(port);
		vl->members |= BIT(port);
		if (untagged && !dsa_is_cpu_port(ds, port))
		if (untagged && !dsa_is_cpu_port(ds, port))
			vl->untag |= BIT(port);
			vl->untag |= BIT(port);
+5 −0
Original line number Original line Diff line number Diff line
@@ -722,6 +722,11 @@ static int aq_ethtool_set_priv_flags(struct net_device *ndev, u32 flags)
	if (flags & ~AQ_PRIV_FLAGS_MASK)
	if (flags & ~AQ_PRIV_FLAGS_MASK)
		return -EOPNOTSUPP;
		return -EOPNOTSUPP;


	if (hweight32((flags | priv_flags) & AQ_HW_LOOPBACK_MASK) > 1) {
		netdev_info(ndev, "Can't enable more than one loopback simultaneously\n");
		return -EINVAL;
	}

	cfg->priv_flags = flags;
	cfg->priv_flags = flags;


	if ((priv_flags ^ flags) & BIT(AQ_HW_LOOPBACK_DMA_NET)) {
	if ((priv_flags ^ flags) & BIT(AQ_HW_LOOPBACK_DMA_NET)) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -163,7 +163,7 @@ aq_check_approve_fvlan(struct aq_nic_s *aq_nic,
	}
	}


	if ((aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
	if ((aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
	    (!test_bit(be16_to_cpu(fsp->h_ext.vlan_tci),
	    (!test_bit(be16_to_cpu(fsp->h_ext.vlan_tci) & VLAN_VID_MASK,
		       aq_nic->active_vlans))) {
		       aq_nic->active_vlans))) {
		netdev_err(aq_nic->ndev,
		netdev_err(aq_nic->ndev,
			   "ethtool: unknown vlan-id specified");
			   "ethtool: unknown vlan-id specified");
Loading