Commit 3e200099 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull networking fixes from Paolo Abeni:
 "This is again significantly bigger than the same point into the
  previous cycle, but at least smaller than last week.

  I'm not aware of any pending regression for the current cycle.

  Including fixes from netfilter.

  Current release - regressions:

    - netfilter: walk fib6_siblings under RCU

  Previous releases - regressions:

    - netlink: fix sending unassigned nsid after assigned one

    - bridge: fix sleep in atomic context in netlink path

    - sched: fix ethx:ingress -> ethy:egress -> ethx:ingress mirred loop

    - ipv4: fix net->ipv4.sysctl_local_reserved_ports UaF

    - eth: tun: free page on short-frame rejection in tun_xdp_one()

  Previous releases - always broken:

    - skbuff: fix missing zerocopy reference in pskb_carve helpers

    - handshake: drain pending requests at net namespace exit

    - ethtool:
       - rss: avoid modifying the RSS context response
       - module: avoid leaking a netdev ref on module flash errors
       - coalesce: cap profile updates at NET_DIM_PARAMS_NUM_PROFILES

    - netfilter: fix dst corruption in same register operation

    - nfc: hci: fix out-of-bounds read in HCP header parsing

    - ipv6: exthdrs: refresh nh pointer after ipv6_hop_jumbo()

    - eth:
       - vti: use ip6_tnl.net in vti6_changelink().
       - vxlan: do not reuse cached ip_hdr() value after
         skb_tunnel_check_pmtu()"

* tag 'net-7.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (94 commits)
  dpll: zl3073x: make frequency monitor a per-device attribute
  dpll: zl3073x: use __dpll_device_change_ntf() and remove change_work
  dpll: export __dpll_device_change_ntf() for use under dpll_lock
  net/handshake: Drain pending requests at net namespace exit
  net/handshake: Verify file-reference balance in submit paths
  net/handshake: Close the submit-side sock_hold race
  net/handshake: hand off the pinned file reference to accept_doit
  net/handshake: Take a long-lived file reference at submit
  net/handshake: Pass negative errno through handshake_complete()
  nvme-tcp: store negative errno in queue->tls_err
  net/handshake: Use spin_lock_bh for hn_lock
  net: skbuff: fix missing zerocopy reference in pskb_carve helpers
  net: hibmcge: move dma_rmb() after dma_sync_single_for_cpu() in RX path
  net: hibmcge: disable Relaxed Ordering to fix RX packet corruption
  selftests/tc-testing: Add netem test case exercising loops
  selftests/tc-testing: Add mirred test cases exercising loops
  net/sched: act_mirred: Fix return code in early mirred redirect error paths
  net/sched: act_mirred: Fix blockcast recursion bypass leading to stack overflow
  net/sched: Fix ethx:ingress -> ethy:egress -> ethx:ingress mirred loop
  net/sched: fix packet loop on netem when duplicate is on
  ...
parents b0f908d7 8d26955e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -12,6 +12,12 @@ protocol: genetlink
doc: Netlink protocol to request a transport layer security handshake.

definitions:
  -
    type: const
    name: max-errno
    value: 4095
    header: linux/err.h
    scope: kernel
  -
    type: enum
    name: handler-class
@@ -80,6 +86,8 @@ attribute-sets:
      -
        name: status
        type: u32
        checks:
          max: max-errno
      -
        name: sockfd
        type: s32
+11 −2
Original line number Diff line number Diff line
@@ -829,12 +829,21 @@ int dpll_device_delete_ntf(struct dpll_device *dpll)
	return dpll_device_event_send(DPLL_CMD_DEVICE_DELETE_NTF, dpll);
}

static int
__dpll_device_change_ntf(struct dpll_device *dpll)
/**
 * __dpll_device_change_ntf - notify that the dpll device has been changed
 * @dpll: registered dpll pointer
 *
 * Context: caller must hold dpll_lock. Suitable for use inside device
 *          callbacks which are already invoked under dpll_lock.
 * Return: 0 if succeeds, error code otherwise.
 */
int __dpll_device_change_ntf(struct dpll_device *dpll)
{
	lockdep_assert_held(&dpll_lock);
	dpll_device_notify(dpll, DPLL_DEVICE_CHANGED);
	return dpll_device_event_send(DPLL_CMD_DEVICE_CHANGE_NTF, dpll);
}
EXPORT_SYMBOL_GPL(__dpll_device_change_ntf);

/**
 * dpll_device_change_ntf - notify that the dpll device has been changed
+8 −11
Original line number Diff line number Diff line
@@ -762,18 +762,15 @@ zl3073x_dev_periodic_work(struct kthread_work *work)
		dev_warn(zldev->dev, "Failed to update phase offsets: %pe\n",
			 ERR_PTR(rc));

	/* Update measured input reference frequencies if any DPLL has
	 * frequency monitoring enabled.
	/* Update measured input reference frequencies if frequency
	 * monitoring is enabled.
	 */
	list_for_each_entry(zldpll, &zldev->dplls, list) {
		if (zldpll->freq_monitor) {
	if (zldev->freq_monitor) {
		rc = zl3073x_ref_freq_meas_update(zldev);
		if (rc)
			dev_warn(zldev->dev,
				 "Failed to update measured frequencies: %pe\n",
				 ERR_PTR(rc));
			break;
		}
	}

	/* Update references' fractional frequency offsets */
+3 −1
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ struct zl3073x_chip_info {
 * @work: periodic work
 * @clock_id: clock id of the device
 * @phase_avg_factor: phase offset measurement averaging factor
 * @freq_monitor: is frequency monitor enabled
 */
struct zl3073x_dev {
	struct device			*dev;
@@ -77,9 +78,10 @@ struct zl3073x_dev {
	struct kthread_worker		*kworker;
	struct kthread_delayed_work	work;

	/* Devlink parameters */
	/* Per-chip parameters */
	u64			clock_id;
	u8			phase_avg_factor;
	bool			freq_monitor;
};

extern const struct regmap_config zl3073x_regmap_config;
+23 −32
Original line number Diff line number Diff line
@@ -1079,15 +1079,6 @@ zl3073x_dpll_phase_offset_avg_factor_get(const struct dpll_device *dpll,
	return 0;
}

static void
zl3073x_dpll_change_work(struct work_struct *work)
{
	struct zl3073x_dpll *zldpll;

	zldpll = container_of(work, struct zl3073x_dpll, change_work);
	dpll_device_change_ntf(zldpll->dpll_dev);
}

static int
zl3073x_dpll_phase_offset_avg_factor_set(const struct dpll_device *dpll,
					 void *dpll_priv, u32 factor,
@@ -1113,8 +1104,10 @@ zl3073x_dpll_phase_offset_avg_factor_set(const struct dpll_device *dpll,
	 * we have to send a notification for other DPLL devices.
	 */
	list_for_each_entry(item, &zldpll->dev->dplls, list) {
		if (item != zldpll)
			schedule_work(&item->change_work);
		struct dpll_device *dpll_dev = READ_ONCE(item->dpll_dev);

		if (item != zldpll && dpll_dev)
			__dpll_device_change_ntf(dpll_dev);
	}

	return 0;
@@ -1219,7 +1212,7 @@ zl3073x_dpll_freq_monitor_get(const struct dpll_device *dpll,
{
	struct zl3073x_dpll *zldpll = dpll_priv;

	if (zldpll->freq_monitor)
	if (zldpll->dev->freq_monitor)
		*state = DPLL_FEATURE_STATE_ENABLE;
	else
		*state = DPLL_FEATURE_STATE_DISABLE;
@@ -1233,9 +1226,19 @@ zl3073x_dpll_freq_monitor_set(const struct dpll_device *dpll,
			      enum dpll_feature_state state,
			      struct netlink_ext_ack *extack)
{
	struct zl3073x_dpll *zldpll = dpll_priv;
	struct zl3073x_dpll *item, *zldpll = dpll_priv;

	zldpll->dev->freq_monitor = (state == DPLL_FEATURE_STATE_ENABLE);

	zldpll->freq_monitor = (state == DPLL_FEATURE_STATE_ENABLE);
	/* The frequency monitoring is common for all DPLL channels so after
	 * change we have to send a notification for other DPLL devices.
	 */
	list_for_each_entry(item, &zldpll->dev->dplls, list) {
		struct dpll_device *dpll_dev = READ_ONCE(item->dpll_dev);

		if (item != zldpll && dpll_dev)
			__dpll_device_change_ntf(dpll_dev);
	}

	return 0;
}
@@ -1627,13 +1630,13 @@ zl3073x_dpll_device_register(struct zl3073x_dpll *zldpll)
static void
zl3073x_dpll_device_unregister(struct zl3073x_dpll *zldpll)
{
	WARN(!zldpll->dpll_dev, "DPLL device is not registered\n");
	struct dpll_device *dpll_dev = READ_ONCE(zldpll->dpll_dev);

	cancel_work_sync(&zldpll->change_work);
	WARN(!dpll_dev, "DPLL device is not registered\n");

	dpll_device_unregister(zldpll->dpll_dev, &zldpll->ops, zldpll);
	dpll_device_put(zldpll->dpll_dev, &zldpll->tracker);
	zldpll->dpll_dev = NULL;
	WRITE_ONCE(zldpll->dpll_dev, NULL);
	dpll_device_unregister(dpll_dev, &zldpll->ops, zldpll);
	dpll_device_put(dpll_dev, &zldpll->tracker);
}

/**
@@ -1752,7 +1755,7 @@ zl3073x_dpll_pin_measured_freq_check(struct zl3073x_dpll_pin *pin)
	u8 ref_id;
	u32 freq;

	if (!zldpll->freq_monitor)
	if (!zldpll->dev->freq_monitor)
		return false;

	ref_id = zl3073x_input_pin_ref_get(pin->id);
@@ -1785,10 +1788,8 @@ zl3073x_dpll_changes_check(struct zl3073x_dpll *zldpll)
	struct zl3073x_dev *zldev = zldpll->dev;
	enum dpll_lock_status lock_status;
	struct device *dev = zldev->dev;
	const struct zl3073x_chan *chan;
	struct zl3073x_dpll_pin *pin;
	int rc;
	u8 mode;

	zldpll->check_count++;

@@ -1807,15 +1808,6 @@ zl3073x_dpll_changes_check(struct zl3073x_dpll *zldpll)
		dpll_device_change_ntf(zldpll->dpll_dev);
	}

	/* Input pin monitoring does make sense only in automatic
	 * or forced reference modes.
	 */
	chan = zl3073x_chan_state_get(zldev, zldpll->id);
	mode = zl3073x_chan_mode_get(chan);
	if (mode != ZL_DPLL_MODE_REFSEL_MODE_AUTO &&
	    mode != ZL_DPLL_MODE_REFSEL_MODE_REFLOCK)
		return;

	/* Update phase offset latch registers for this DPLL if the phase
	 * offset monitor feature is enabled.
	 */
@@ -1926,7 +1918,6 @@ zl3073x_dpll_alloc(struct zl3073x_dev *zldev, u8 ch)
	zldpll->dev = zldev;
	zldpll->id = ch;
	INIT_LIST_HEAD(&zldpll->pins);
	INIT_WORK(&zldpll->change_work, zl3073x_dpll_change_work);

	return zldpll;
}
Loading