Commit 896d8946 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull networking fixes from Paolo Abeni:
 "Including fixes from can and netfilter.

  Current release - regressions:

   - rtnetlink: fix double call of rtnl_link_get_net_ifla()

   - tcp: populate XPS related fields of timewait sockets

   - ethtool: fix access to uninitialized fields in set RXNFC command

   - selinux: use sk_to_full_sk() in selinux_ip_output()

  Current release - new code bugs:

   - net: make napi_hash_lock irq safe

   - eth:
      - bnxt_en: support header page pool in queue API
      - ice: fix NULL pointer dereference in switchdev

  Previous releases - regressions:

   - core: fix icmp host relookup triggering ip_rt_bug

   - ipv6:
      - avoid possible NULL deref in modify_prefix_route()
      - release expired exception dst cached in socket

   - smc: fix LGR and link use-after-free issue

   - hsr: avoid potential out-of-bound access in fill_frame_info()

   - can: hi311x: fix potential use-after-free

   - eth: ice: fix VLAN pruning in switchdev mode

  Previous releases - always broken:

   - netfilter:
      - ipset: hold module reference while requesting a module
      - nft_inner: incorrect percpu area handling under softirq

   - can: j1939: fix skb reference counting

   - eth:
      - mlxsw: use correct key block on Spectrum-4
      - mlx5: fix memory leak in mlx5hws_definer_calc_layout"

* tag 'net-6.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (76 commits)
  net :mana :Request a V2 response version for MANA_QUERY_GF_STAT
  net: avoid potential UAF in default_operstate()
  vsock/test: verify socket options after setting them
  vsock/test: fix parameter types in SO_VM_SOCKETS_* calls
  vsock/test: fix failures due to wrong SO_RCVLOWAT parameter
  net/mlx5e: Remove workaround to avoid syndrome for internal port
  net/mlx5e: SD, Use correct mdev to build channel param
  net/mlx5: E-Switch, Fix switching to switchdev mode in MPV
  net/mlx5: E-Switch, Fix switching to switchdev mode with IB device disabled
  net/mlx5: HWS: Properly set bwc queue locks lock classes
  net/mlx5: HWS: Fix memory leak in mlx5hws_definer_calc_layout
  bnxt_en: handle tpa_info in queue API implementation
  bnxt_en: refactor bnxt_alloc_rx_rings() to call bnxt_alloc_rx_agg_bmap()
  bnxt_en: refactor tpa_info alloc/free into helpers
  geneve: do not assume mac header is set in geneve_xmit_skb()
  mlxsw: spectrum_acl_flex_keys: Use correct key block on Spectrum-4
  ethtool: Fix wrong mod state in case of verbose and no_mask bitset
  ipmr: tune the ipmr_can_free_table() checks.
  netfilter: nft_set_hash: skip duplicated elements pending gc run
  netfilter: ipset: Hold module reference while requesting a module
  ...
parents 9d6a414a 31f1b55d
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -6,16 +6,17 @@ Bare UDP Tunnelling Module Documentation

There are various L3 encapsulation standards using UDP being discussed to
leverage the UDP based load balancing capability of different networks.
MPLSoUDP (__ https://tools.ietf.org/html/rfc7510) is one among them.
MPLSoUDP (https://tools.ietf.org/html/rfc7510) is one among them.

The Bareudp tunnel module provides a generic L3 encapsulation support for
tunnelling different L3 protocols like MPLS, IP, NSH etc. inside a UDP tunnel.

Special Handling
----------------

The bareudp device supports special handling for MPLS & IP as they can have
multiple ethertypes.
MPLS procotcol can have ethertypes ETH_P_MPLS_UC  (unicast) & ETH_P_MPLS_MC (multicast).
The MPLS protocol can have ethertypes ETH_P_MPLS_UC (unicast) & ETH_P_MPLS_MC (multicast).
IP protocol can have ethertypes ETH_P_IP (v4) & ETH_P_IPV6 (v6).
This special handling can be enabled only for ethertypes ETH_P_IP & ETH_P_MPLS_UC
with a flag called multiproto mode.
@@ -52,7 +53,7 @@ be enabled explicitly with the "multiproto" flag.
3) Device Usage

The bareudp device could be used along with OVS or flower filter in TC.
The OVS or TC flower layer must set the tunnel information in SKB dst field before
sending packet buffer to the bareudp device for transmission. On reception the
bareudp device extracts and stores the tunnel information in SKB dst field before
The OVS or TC flower layer must set the tunnel information in the SKB dst field before
sending the packet buffer to the bareudp device for transmission. On reception, the
bareUDP device extracts and stores the tunnel information in the SKB dst field before
passing the packet buffer to the network stack.
+1 −0
Original line number Diff line number Diff line
@@ -16267,6 +16267,7 @@ F: Documentation/devicetree/bindings/net/
F:	Documentation/networking/net_cachelines/net_device.rst
F:	drivers/connector/
F:	drivers/net/
F:	drivers/ptp/
F:	include/dt-bindings/net/
F:	include/linux/cn_proc.h
F:	include/linux/etherdevice.h
+17 −9
Original line number Diff line number Diff line
@@ -1014,42 +1014,47 @@ static int c_can_handle_bus_err(struct net_device *dev,

	/* propagate the error condition to the CAN stack */
	skb = alloc_can_err_skb(dev, &cf);
	if (unlikely(!skb))
		return 0;

	/* check for 'last error code' which tells us the
	 * type of the last error to occur on the CAN bus
	 */
	if (likely(skb))
		cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;

	switch (lec_type) {
	case LEC_STUFF_ERROR:
		netdev_dbg(dev, "stuff error\n");
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_STUFF;
		stats->rx_errors++;
		break;
	case LEC_FORM_ERROR:
		netdev_dbg(dev, "form error\n");
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_FORM;
		stats->rx_errors++;
		break;
	case LEC_ACK_ERROR:
		netdev_dbg(dev, "ack error\n");
		if (likely(skb))
			cf->data[3] = CAN_ERR_PROT_LOC_ACK;
		stats->tx_errors++;
		break;
	case LEC_BIT1_ERROR:
		netdev_dbg(dev, "bit1 error\n");
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_BIT1;
		stats->tx_errors++;
		break;
	case LEC_BIT0_ERROR:
		netdev_dbg(dev, "bit0 error\n");
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_BIT0;
		stats->tx_errors++;
		break;
	case LEC_CRC_ERROR:
		netdev_dbg(dev, "CRC error\n");
		if (likely(skb))
			cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
		stats->rx_errors++;
		break;
@@ -1057,6 +1062,9 @@ static int c_can_handle_bus_err(struct net_device *dev,
		break;
	}

	if (unlikely(!skb))
		return 0;

	netif_receive_skb(skb);
	return 1;
}
+1 −1
Original line number Diff line number Diff line
@@ -468,7 +468,7 @@ static int can_set_termination(struct net_device *ndev, u16 term)
	else
		set = 0;

	gpiod_set_value(priv->termination_gpio, set);
	gpiod_set_value_cansleep(priv->termination_gpio, set);

	return 0;
}
+40 −18
Original line number Diff line number Diff line
@@ -390,36 +390,55 @@ static int ifi_canfd_handle_lec_err(struct net_device *ndev)
		return 0;

	priv->can.can_stats.bus_error++;
	stats->rx_errors++;

	/* Propagate the error condition to the CAN stack. */
	skb = alloc_can_err_skb(ndev, &cf);
	if (unlikely(!skb))
		return 0;

	/* Read the error counter register and check for new errors. */
	if (likely(skb))
		cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;

	if (errctr & IFI_CANFD_ERROR_CTR_OVERLOAD_FIRST)
	if (errctr & IFI_CANFD_ERROR_CTR_OVERLOAD_FIRST) {
		stats->rx_errors++;
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_OVERLOAD;
	}

	if (errctr & IFI_CANFD_ERROR_CTR_ACK_ERROR_FIRST)
	if (errctr & IFI_CANFD_ERROR_CTR_ACK_ERROR_FIRST) {
		stats->tx_errors++;
		if (likely(skb))
			cf->data[3] = CAN_ERR_PROT_LOC_ACK;
	}

	if (errctr & IFI_CANFD_ERROR_CTR_BIT0_ERROR_FIRST)
	if (errctr & IFI_CANFD_ERROR_CTR_BIT0_ERROR_FIRST) {
		stats->tx_errors++;
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_BIT0;
	}

	if (errctr & IFI_CANFD_ERROR_CTR_BIT1_ERROR_FIRST)
	if (errctr & IFI_CANFD_ERROR_CTR_BIT1_ERROR_FIRST) {
		stats->tx_errors++;
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_BIT1;
	}

	if (errctr & IFI_CANFD_ERROR_CTR_STUFF_ERROR_FIRST)
	if (errctr & IFI_CANFD_ERROR_CTR_STUFF_ERROR_FIRST) {
		stats->rx_errors++;
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_STUFF;
	}

	if (errctr & IFI_CANFD_ERROR_CTR_CRC_ERROR_FIRST)
	if (errctr & IFI_CANFD_ERROR_CTR_CRC_ERROR_FIRST) {
		stats->rx_errors++;
		if (likely(skb))
			cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
	}

	if (errctr & IFI_CANFD_ERROR_CTR_FORM_ERROR_FIRST)
	if (errctr & IFI_CANFD_ERROR_CTR_FORM_ERROR_FIRST) {
		stats->rx_errors++;
		if (likely(skb))
			cf->data[2] |= CAN_ERR_PROT_FORM;
	}

	/* Reset the error counter, ack the IRQ and re-enable the counter. */
	writel(IFI_CANFD_ERROR_CTR_ER_RESET, priv->base + IFI_CANFD_ERROR_CTR);
@@ -427,6 +446,9 @@ static int ifi_canfd_handle_lec_err(struct net_device *ndev)
	       priv->base + IFI_CANFD_INTERRUPT);
	writel(IFI_CANFD_ERROR_CTR_ER_ENABLE, priv->base + IFI_CANFD_ERROR_CTR);

	if (unlikely(!skb))
		return 0;

	netif_receive_skb(skb);

	return 1;
Loading