Skip to contentSkip to conversation

6.12.92-rc1 review

PATCH In review Greg Kroah-Hartman 15 participants 298 messages May 28 – Sep 18 Page 3 of 3

Subsystems (4)
lore
Share & tools
lore
Tested-by on the v1 series
#296 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.12.92 release. There are 272 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 30 May 2026 19:45:52 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.92-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
and the diffstat can be found below.

thanks,

greg k-h

On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:

Signature · 1 line
Florian
#292 lore raw
In reply to Sasha Levin
Quoted 7 lines · Sasha Levin
Quoted 6 lines · Pavel Machek
Quoted 6 lines

I am seeing:

./include/linux/bio-integrity.h:101:12: error: unused function 'bio_integrity_map_user' [-Werror,-Wunused-function]

This looks like it needs:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
   546d191427cf ("block: make bio_integrity_map_user() static inline")

We see that, too:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/jobs/14592368004
We don't see the problem on 6.6, 6.18 or 7.0-stable.

Thanks! I've queued up 546d191427cf ("block: make bio_integrity_map_user() static inline").

Thanks, also seen here, FWIW.

Signature · 1 line
Florian
#176 lore raw

Re: [PATCH 6.12 168/272] netfilter: Exclude LEGACY TABLES on PREEMPT_RT.

In reply to Greg Kroah-Hartman

Hi,

Quoted 78 lines · Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <[email protected]>

[ Upstream commit 9fce66583f06c212e95e4b76dd61d8432ffa56b6 ]

The seqcount xt_recseq is used to synchronize the replacement of xt_table::private in xt_replace_table() against all readers such as ipt_do_table()

To ensure that there is only one writer, the writing side disables bottom halves. The sequence counter can be acquired recursively. Only the first invocation modifies the sequence counter (signaling that a writer is in progress) while the following (recursive) writer does not modify the counter.
The lack of a proper locking mechanism for the sequence counter can lead to live lock on PREEMPT_RT if the high prior reader preempts the writer. Additionally if the per-CPU lock on PREEMPT_RT is removed from local_bh_disable() then there is no synchronisation for the per-CPU sequence counter.

The affected code is "just" the legacy netfilter code which is replaced by "netfilter tables". That code can be disabled without sacrificing functionality because everything is provided by the newer implementation. This will only requires the usage of the "-nft" tools instead of the "-legacy" ones.
The long term plan is to remove the legacy code so lets accelerate the progress.

Relax dependencies on iptables legacy, replace select with depends on, this should cause no harm to existing kernel configs and users can still toggle IP{6}_NF_IPTABLES_LEGACY in any case.
Make EBTABLES_LEGACY, IPTABLES_LEGACY and ARPTABLES depend on NETFILTER_XTABLES_LEGACY. Hide xt_recseq and its users, xt_register_table() and xt_percpu_counter_alloc() behind NETFILTER_XTABLES_LEGACY. Let NETFILTER_XTABLES_LEGACY depend on !PREEMPT_RT.

This will break selftest expecing the legacy options enabled and will be addressed in a following patch.

Stable-dep-of: b4597d5fd7d2 ("netfilter: x_tables: add and use xtables_unregister_table_exit")

---
  net/bridge/netfilter/Kconfig | 10 +++++-----
  net/ipv4/netfilter/Kconfig   | 24 ++++++++++++------------
  net/ipv6/netfilter/Kconfig   | 19 +++++++++----------
  net/netfilter/Kconfig        | 10 ++++++++++
  net/netfilter/x_tables.c     | 16 +++++++++++-----
  5 files changed, 47 insertions(+), 32 deletions(-)

...

net/ipv6/netfilter/Kconfig +1 -1
@@ -269,8 +268,8 @@ config IP6_NF_NAT
  	tristate "ip6tables NAT support"
  	depends on NF_CONNTRACK
  	depends on NETFILTER_ADVANCED
+	depends on IP6_NF_IPTABLES_LEGACY
  	select NF_NAT
-	select IP6_NF_IPTABLES_LEGACY
  	select NETFILTER_XT_NAT
  	help
  	  This enables the `nat' table in ip6tables. This allows masquerading,
net/netfilter/Kconfig +1 -0
index df2dc21304efb..0d1d997abe191 100644
@@ -762,6 +762,16 @@ config NETFILTER_XTABLES_COMPAT
 
  	   If unsure, say N.
 
+config NETFILTER_XTABLES_LEGACY

net/netfilter/Kconfig config NETFILTER_XTABLES_COMPAT · line 775

Quoted 10 lines
net/netfilter/Kconfig +9 -0
+	bool "Netfilter legacy tables support"
+	depends on !PREEMPT_RT
+	help
+	  Say Y here if you still require support for legacy tables. This is
+	  required by the legacy tools (iptables-legacy) and is not needed if
+	  you use iptables over nftables (iptables-nft).
+	  Legacy support is not limited to IP, it also includes EBTABLES and
+	  ARPTABLES.
+
  comment "Xtables combined modules"

That changes quite a bit of configs if we don't set this to y, also a note for other distros.

Also there is a missing fix for this that I see:

v6.17-rc2 - 25a8b88f000c [fix] netfilter: add back NETFILTER_XTABLES dependencies

I am wondering if we could backport race fixes by resolving conflicts instead.

Thanks,
Harshit

Quoted 60 lines
net/netfilter/Kconfig +0 -0
  config NETFILTER_XT_MARK
net/netfilter/x_tables.c +11 -5
index efe7b7d71e7f7..1ca4fa9d249b8 100644
@@ -1340,12 +1340,13 @@ void xt_compat_unlock(u_int8_t af)
  EXPORT_SYMBOL_GPL(xt_compat_unlock);
  #endif
 
-DEFINE_PER_CPU(seqcount_t, xt_recseq);
-EXPORT_PER_CPU_SYMBOL_GPL(xt_recseq);
-
  struct static_key xt_tee_enabled __read_mostly;
  EXPORT_SYMBOL_GPL(xt_tee_enabled);
 
+#ifdef CONFIG_NETFILTER_XTABLES_LEGACY
+DEFINE_PER_CPU(seqcount_t, xt_recseq);
+EXPORT_PER_CPU_SYMBOL_GPL(xt_recseq);
+
  static int xt_jumpstack_alloc(struct xt_table_info *i)
  {
  	unsigned int size;
@@ -1537,6 +1538,7 @@ void *xt_unregister_table(struct xt_table *table)
  	return private;
  }
  EXPORT_SYMBOL_GPL(xt_unregister_table);
+#endif
 
  #ifdef CONFIG_PROC_FS
  static void *xt_table_seq_start(struct seq_file *seq, loff_t *pos)
@@ -1920,6 +1922,7 @@ void xt_proto_fini(struct net *net, u_int8_t af)
  }
  EXPORT_SYMBOL_GPL(xt_proto_fini);
 
+#ifdef CONFIG_NETFILTER_XTABLES_LEGACY
  /**
   * xt_percpu_counter_alloc - allocate x_tables rule counter
   *
@@ -1974,6 +1977,7 @@ void xt_percpu_counter_free(struct xt_counters *counters)
  		free_percpu((void __percpu *)pcnt);
  }
  EXPORT_SYMBOL_GPL(xt_percpu_counter_free);
+#endif
 
  static int __net_init xt_net_init(struct net *net)
  {
@@ -2006,8 +2010,10 @@ static int __init xt_init(void)
  	unsigned int i;
  	int rv;
 
-	for_each_possible_cpu(i) {
-		seqcount_init(&per_cpu(xt_recseq, i));
+	if (IS_ENABLED(CONFIG_NETFILTER_XTABLES_LEGACY)) {
+		for_each_possible_cpu(i) {
+			seqcount_init(&per_cpu(xt_recseq, i));
+		}
  	}
 
  	xt = kcalloc(NFPROTO_NUMPROTO, sizeof(struct xt_af), GFP_KERNEL);
#18 lore raw

Re: [PATCH 6.12 017/272] sched/deadline: Always stop dl-server before changing parameters

In reply to Greg Kroah-Hartman

Hi Greg/Sasha,

Quoted 37 lines · Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Juri Lelli <[email protected]>

commit bb4700adc3abec34c0a38b64f66258e4e233fc16 upstream.

Commit cccb45d7c4295 ("sched/deadline: Less agressive dl_server handling") reduced dl-server overhead by delaying disabling servers only after there are no fair task around for a whole period, which means that deadline entities are not dequeued right away on a server stop event. However, the delay opens up a window in which a request for changing server parameters can break per-runqueue running_bw tracking, as reported by Yuri.

Close the problematic window by unconditionally calling dl_server_stop() before applying the new parameters (ensuring deadline entities go through an actual dequeue).

---
  kernel/sched/debug.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
kernel/sched/debug.c +0 -0
index 7d14e9fa53ac3..564ea17ae405e 100644

kernel/sched/debug.c static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu · line 383

Quoted 10 lines
kernel/sched/debug.c +2 -4
@@ -378,10 +378,8 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
  			return  -EINVAL;
  		}
 
-		if (rq->cfs.h_nr_queued) {
-			update_rq_clock(rq);
-			dl_server_stop(&rq->fair_server);
-		}
+		update_rq_clock(rq);
+		dl_server_stop(&rq->fair_server);
 

I have run an AI assisted backport review and took a look at this one.

I think 6.12.y is missing what upstream has:

The backport makes sched_fair_server_write() always do:

update_rq_clock(rq);
dl_server_stop(&rq->fair_server);

That matches upstream bb4700adc3ab, but upstream also has this in dl_server_stop():

if (!dl_server(dl_se) || !dl_server_active(dl_se))

        return;

6.12.y only has:

if (!dl_se->dl_runtime)

        return;

so an inactive but configured fair server can still go through the deadline dequeue accounting path.

So it looks like this backport is not very safe. Thoughts ?

thanks,
Harshit

Quoted 2 lines
kernel/sched/debug.c +0 -0
  		retval = dl_server_apply_params(&rq->fair_server, runtime, period, 0);
 
#33 lore raw

Re: [PATCH 6.12 030/272] Revert "ice: fix double-free of tx_buf skb"

In reply to Greg Kroah-Hartman

Hi Sasha/Greg,

Quoted 35 lines · Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

This reverts commit fd95ef8d0f6dbe2daa95d6488c9e0f8a95a7e048.

---
  drivers/net/ethernet/intel/ice/ice_txrx.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_txrx.c +2 -3
index 48434a79869cb..08d1757f40888 100644
@@ -2346,9 +2346,6 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
 
  	ice_trace(xmit_frame_ring, tx_ring, skb);
 
-	/* record the location of the first descriptor for this packet */
-	first = &tx_ring->tx_buf[tx_ring->next_to_use];
-
  	count = ice_xmit_desc_count(skb);
  	if (ice_chk_linearize(skb, count)) {
  		if (__skb_linearize(skb))
@@ -2374,6 +2371,8 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
 
  	offload.tx_ring = tx_ring;
 
+	/* record the location of the first descriptor for this packet */
+	first = &tx_ring->tx_buf[tx_ring->next_to_use];
  	first->skb = skb;
  	first->type = ICE_TX_BUF_SKB;
  	first->bytecount = max_t(unsigned int, skb->len, ETH_ZLEN);

drivers/net/ethernet/intel/ice/ice_txrx.c ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring) · line 2440

Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_txrx.c +0 -1
@@ -2437,7 +2436,6 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
  out_drop:
  	ice_trace(xmit_frame_ring_drop, tx_ring, skb);
  	dev_kfree_skb_any(skb);
-	first->type = ICE_TX_BUF_EMPTY;
  	return NETDEV_TX_OK;
  }

I ran an AI-assisted backport review and then checked this one against the 6.12.y tree.

I think this purely opens the issue again back, we need some sort of TODO list for tracking these backports that are reverted for now.

Issue goes back like this

That fix(what we are reverting) made ice_xmit_frame_ring() clear the TX buffer state on the drop path:

dev_kfree_skb_any(skb);
first->type = ICE_TX_BUF_EMPTY;

After the revert, first->skb is still recorded and first->type is still set to ICE_TX_BUF_SKB before ice_tso() / ice_tx_csum(), but the error path now only frees the skb and returns.

Later ice_clean_tx_ring() -> ice_unmap_and_free_tx_buf() still treats ICE_TX_BUF_SKB as owning a live skb and frees tx_buf->skb.

So its again the same issue coming back to stable.

I looked up the reason for the revert and the reason for the revert is we took a prerequisite for this which doesn't fit will so to revert the prerequisite we reverted this fix as well, I think we need adapted patch to older stable trees.

https://lore.kernel.org/all/[email protected]/

Nothing to do now but I think we need to add some sort TODO-backports list in stable-queue , thoughts ?

thanks,
Harshit

Quoted 1 line
#46 lore raw

Re: [PATCH 6.12 041/272] i3c: mipi-i3c-hci: Correct RING_CTRL_ABORT handling in DMA dequeue

In reply to Greg Kroah-Hartman

Hi Greg/Sasha,

Quoted 61 lines · Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Adrian Hunter <[email protected]>

[ Upstream commit b795e68bf3073d67bebbb5a44d93f49efc5b8cc7 ]

The logic used to abort the DMA ring contains several flaws:

1. The driver unconditionally issues a ring abort even when the ring has already stopped.
2. The completion used to wait for abort completion is never re-initialized, resulting in incorrect wait behavior.
3. The abort sequence unintentionally clears RING_CTRL_ENABLE, which resets hardware ring pointers and disrupts the controller state.
4. If the ring is already stopped, the abort operation should be considered successful without attempting further action.

Fix the abort handling by checking whether the ring is running before issuing an abort, re-initializing the completion when needed, ensuring that RING_CTRL_ENABLE remains asserted during abort, and treating an already stopped ring as a successful condition.

---
  drivers/i3c/master/mipi-i3c-hci/dma.c | 27 +++++++++++++++++----------
  1 file changed, 17 insertions(+), 10 deletions(-)
drivers/i3c/master/mipi-i3c-hci/dma.c +7 -10
index b9496e8c4784d..44461f13b54cd 100644
@@ -457,16 +457,23 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci,
  	struct hci_rh_data *rh = &rings->headers[xfer_list[0].ring_number];
  	unsigned int i;
  	bool did_unqueue = false;
-
-	/* stop the ring */
-	rh_reg_write(RING_CONTROL, RING_CTRL_ABORT);
-	if (wait_for_completion_timeout(&rh->op_done, HZ) == 0) {
-		/*
-		 * We're deep in it if ever this condition is ever met.
-		 * Hardware might still be writing to memory, etc.
-		 */
-		dev_crit(&hci->master.dev, "unable to abort the ring\n");
-		WARN_ON(1);
+	u32 ring_status;
+
+	ring_status = rh_reg_read(RING_STATUS);
+	if (ring_status & RING_STATUS_RUNNING) {
+		/* stop the ring */
+		reinit_completion(&rh->op_done);
+		rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_ABORT);

drivers/i3c/master/mipi-i3c-hci/dma.c static bool hci_dma_dequeue_xfer(struct i3c_hci *hci, · line 476

Quoted 10 lines
drivers/i3c/master/mipi-i3c-hci/dma.c +10 -0
+		wait_for_completion_timeout(&rh->op_done, HZ);
+		ring_status = rh_reg_read(RING_STATUS);
+		if (ring_status & RING_STATUS_RUNNING) {
+			/*
+			 * We're deep in it if ever this condition is ever met.
+			 * Hardware might still be writing to memory, etc.
+			 */
+			dev_crit(&hci->master.dev, "unable to abort the ring\n");
+			WARN_ON(1);
+		}

I ran an AI-assisted backport review and checked the 6.12.y tree.

The posted backport adds the RING_CTRL_ABORT completion handling, including:

    reinit_completion(&rh->op_done);
    rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_ABORT);
    wait_for_completion_timeout(&rh->op_done, HZ);

In upstream b795e68bf307, that path runs under hci->control_mutex, and the ring bookkeeping is also serialized with hci->lock.

@@ -546,18 +546,25 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci,

        struct hci_rh_data *rh = &rings->headers[xfer_list[0].ring_number];
        unsigned int i;
        bool did_unqueue = false;

+ u32 ring_status;

        guard(mutex)(&hci->control_mutex);
-       /* stop the ring */
-       rh_reg_write(RING_CONTROL, RING_CTRL_ABORT);
-       if (wait_for_completion_timeout(&rh->op_done, HZ) == 0) {
-               /*
-                * We're deep in it if ever this condition is ever met.
-                * Hardware might still be writing to memory, etc.
-                */

- dev_crit(&hci->master.dev, "unable to abort the ring\n");
- WARN_ON(1);
+ ring_status = rh_reg_read(RING_STATUS);
+ if (ring_status & RING_STATUS_RUNNING) {

+               /* stop the ring */
+               reinit_completion(&rh->op_done);
+               rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_ABORT);
+               wait_for_completion_timeout(&rh->op_done, HZ);
+               ring_status = rh_reg_read(RING_STATUS);
+               if (ring_status & RING_STATUS_RUNNING) {
+                       /*
+                        * We're deep in it if ever this condition is ever met.
+                        * Hardware might still be writing to memory, etc.
+                        */
+                       dev_crit(&hci->master.dev, "unable to abort the ring\n");
+                       WARN_ON(1);
+               }
        }

        spin_lock_irq(&hci->lock);

Downstream 6.12.y has the new reinit_completion() path, but it still lacks the MIPI I3C HCI control_mutex and the IRQ/dequeue ring-state locking.

So the backport can reinitialize and wait on the shared ring completion while another timeout/dequeue or IRQ completion path is still touching the same transfer state. Thoughts ?

Maybe we should drop this for now and queue it up with its prerequisites together ?

thanks,
Harshit

Quoted 3 lines
drivers/i3c/master/mipi-i3c-hci/dma.c +0 -0
  	}
 
  	for (i = 0; i < n; i++) {
#47 lore raw

Re: [PATCH 6.12 041/272] i3c: mipi-i3c-hci: Correct RING_CTRL_ABORT handling in DMA dequeue

Quoted 130 lines · Harshit Mogalapalli

Hi Greg/Sasha,

Quoted 62 lines · Greg Kroah-Hartman

6.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Adrian Hunter <[email protected]>

[ Upstream commit b795e68bf3073d67bebbb5a44d93f49efc5b8cc7 ]

The logic used to abort the DMA ring contains several flaws:

  1. The driver unconditionally issues a ring abort even when the ring has already stopped.
  2. The completion used to wait for abort completion is never re-initialized, resulting in incorrect wait behavior.
  3. The abort sequence unintentionally clears RING_CTRL_ENABLE, which resets hardware ring pointers and disrupts the controller state.
  4. If the ring is already stopped, the abort operation should be considered successful without attempting further action.

Fix the abort handling by checking whether the ring is running before issuing an abort, re-initializing the completion when needed, ensuring that RING_CTRL_ENABLE remains asserted during abort, and treating an already stopped ring as a successful condition.

---
  drivers/i3c/master/mipi-i3c-hci/dma.c | 27 +++++++++++++++++----------

  1 file changed, 17 insertions(+), 10 deletions(-)
drivers/i3c/master/mipi-i3c-hci/dma.c +7 -10
index b9496e8c4784d..44461f13b54cd 100644
@@ -457,16 +457,23 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci 
 *hci,
       struct hci_rh_data *rh = &rings->headers[xfer_list[0].ring_number];
       unsigned int i;
       bool did_unqueue = false;
-
-    /* stop the ring */
-    rh_reg_write(RING_CONTROL, RING_CTRL_ABORT);
-    if (wait_for_completion_timeout(&rh->op_done, HZ) == 0) {
-        /*
-         * We're deep in it if ever this condition is ever met.
-         * Hardware might still be writing to memory, etc.
-         */
-        dev_crit(&hci->master.dev, "unable to abort the ring\n");
-        WARN_ON(1);
+    u32 ring_status;
+
+    ring_status = rh_reg_read(RING_STATUS);
+    if (ring_status & RING_STATUS_RUNNING) {
+        /* stop the ring */
+        reinit_completion(&rh->op_done);
+        rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_ABORT);

drivers/i3c/master/mipi-i3c-hci/dma.c static bool hci_dma_dequeue_xfer(struct i3c_hci · line 477

Quoted 10 lines
drivers/i3c/master/mipi-i3c-hci/dma.c +10 -0
+        wait_for_completion_timeout(&rh->op_done, HZ);
+        ring_status = rh_reg_read(RING_STATUS);
+        if (ring_status & RING_STATUS_RUNNING) {
+            /*
+             * We're deep in it if ever this condition is ever met.
+             * Hardware might still be writing to memory, etc.
+             */
+            dev_crit(&hci->master.dev, "unable to abort the ring\n");
+            WARN_ON(1);
+        }

I ran an AI-assisted backport review and checked the 6.12.y tree.

The posted backport adds the RING_CTRL_ABORT completion handling, including:

    reinit_completion(&rh->op_done); rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_ABORT); wait_for_completion_timeout(&rh->op_done, HZ);

In upstream b795e68bf307, that path runs under hci->control_mutex, and the ring bookkeeping is also serialized with hci->lock.

drivers/i3c/master/mipi-i3c-hci/dma.c +11 -9
@@ -546,18 +546,25 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci,
         struct hci_rh_data *rh = &rings- 
 >headers[xfer_list[0].ring_number];
         unsigned int i;
         bool did_unqueue = false;
+       u32 ring_status;
 
         guard(mutex)(&hci->control_mutex);
 
-       /* stop the ring */
-       rh_reg_write(RING_CONTROL, RING_CTRL_ABORT);
-       if (wait_for_completion_timeout(&rh->op_done, HZ) == 0) {
-               /*
-                * We're deep in it if ever this condition is ever met.
-                * Hardware might still be writing to memory, etc.
-                */
-               dev_crit(&hci->master.dev, "unable to abort the ring\n");
-               WARN_ON(1);
+       ring_status = rh_reg_read(RING_STATUS);
+       if (ring_status & RING_STATUS_RUNNING) {
+               /* stop the ring */
+               reinit_completion(&rh->op_done);
+               rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | 
 RING_CTRL_ABORT);
+               wait_for_completion_timeout(&rh->op_done, HZ);
+               ring_status = rh_reg_read(RING_STATUS);
+               if (ring_status & RING_STATUS_RUNNING) {
+                       /*
+                        * We're deep in it if ever this condition is 

ever met.
+                        * Hardware might still be writing to memory, etc. +                        */
+                       dev_crit(&hci->master.dev, "unable to abort the ring\n");
+                       WARN_ON(1);
+               }
        }

        spin_lock_irq(&hci->lock);

Quoted 5 lines

Downstream 6.12.y has the new reinit_completion() path, but it still lacks the MIPI I3C HCI control_mutex and the IRQ/dequeue ring-state locking.

So the backport can reinitialize and wait on the shared ring completion while another timeout/dequeue or IRQ completion path is still touching the same transfer state. Thoughts ?

Maybe we should drop this for now and queue it up with its prerequisites together ?

Forgot to metnion, the prerequisites are 1dca8aee80ee ("i3c: mipi-i3c-hci: Fix race in DMA ring dequeue") and f0b5159637ca ("i3c: mipi-i3c-hci: Fix race between DMA ring dequeue and interrupt handler")

thanks,
Harshit

Quoted 11 lines

thanks,
Harshit

Quoted 2 lines
drivers/i3c/master/mipi-i3c-hci/dma.c +0 -0
       }
       for (i = 0; i < n; i++) {
author maintainer
#19 lore raw

Re: [PATCH 6.12 017/272] sched/deadline: Always stop dl-server before changing parameters

In reply to Harshit Mogalapalli
Quoted 67 lines · Harshit Mogalapalli

Hi Greg/Sasha,

Quoted 37 lines · Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Juri Lelli <[email protected]>

commit bb4700adc3abec34c0a38b64f66258e4e233fc16 upstream.

Commit cccb45d7c4295 ("sched/deadline: Less agressive dl_server handling") reduced dl-server overhead by delaying disabling servers only after there are no fair task around for a whole period, which means that deadline entities are not dequeued right away on a server stop event. However, the delay opens up a window in which a request for changing server parameters can break per-runqueue running_bw tracking, as reported by Yuri.

Close the problematic window by unconditionally calling dl_server_stop() before applying the new parameters (ensuring deadline entities go through an actual dequeue).

---
  kernel/sched/debug.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
kernel/sched/debug.c +0 -0
index 7d14e9fa53ac3..564ea17ae405e 100644

kernel/sched/debug.c static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu · line 381

Quoted 8 lines
kernel/sched/debug.c +2 -4
@@ -378,10 +378,8 @@ static ssize_t sched_fair_server_write(struct file *filp, const char __user *ubu
  			return  -EINVAL;
  		}
-		if (rq->cfs.h_nr_queued) {
-			update_rq_clock(rq);
-			dl_server_stop(&rq->fair_server);
-		}
+		update_rq_clock(rq);
+		dl_server_stop(&rq->fair_server);

I have run an AI assisted backport review and took a look at this one.

I think 6.12.y is missing what upstream has:

The backport makes sched_fair_server_write() always do:

update_rq_clock(rq);
dl_server_stop(&rq->fair_server);

That matches upstream bb4700adc3ab, but upstream also has this in dl_server_stop():

if (!dl_server(dl_se) || !dl_server_active(dl_se))

        return;

6.12.y only has:

Quoted 7 lines

if (!dl_se->dl_runtime)

        return;

so an inactive but configured fair server can still go through the deadline dequeue accounting path.

So it looks like this backport is not very safe. Thoughts ?

Now dropped, thanks.

greg k-h

author maintainer
#34 lore raw

Re: [PATCH 6.12 030/272] Revert "ice: fix double-free of tx_buf skb"

In reply to Harshit Mogalapalli
Quoted 70 lines · Harshit Mogalapalli

Hi Sasha/Greg,

Quoted 31 lines · Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

This reverts commit fd95ef8d0f6dbe2daa95d6488c9e0f8a95a7e048.

---
  drivers/net/ethernet/intel/ice/ice_txrx.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_txrx.c +2 -3
index 48434a79869cb..08d1757f40888 100644
@@ -2346,9 +2346,6 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
  	ice_trace(xmit_frame_ring, tx_ring, skb);
-	/* record the location of the first descriptor for this packet */
-	first = &tx_ring->tx_buf[tx_ring->next_to_use];
-
  	count = ice_xmit_desc_count(skb);
  	if (ice_chk_linearize(skb, count)) {
  		if (__skb_linearize(skb))
@@ -2374,6 +2371,8 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
  	offload.tx_ring = tx_ring;
+	/* record the location of the first descriptor for this packet */
+	first = &tx_ring->tx_buf[tx_ring->next_to_use];
  	first->skb = skb;
  	first->type = ICE_TX_BUF_SKB;
  	first->bytecount = max_t(unsigned int, skb->len, ETH_ZLEN);

drivers/net/ethernet/intel/ice/ice_txrx.c ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring) · line 2440

Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_txrx.c +0 -1
@@ -2437,7 +2436,6 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
  out_drop:
  	ice_trace(xmit_frame_ring_drop, tx_ring, skb);
  	dev_kfree_skb_any(skb);
-	first->type = ICE_TX_BUF_EMPTY;
  	return NETDEV_TX_OK;
  }

I ran an AI-assisted backport review and then checked this one against the 6.12.y tree.

I think this purely opens the issue again back, we need some sort of TODO list for tracking these backports that are reverted for now.

Issue goes back like this

That fix(what we are reverting) made ice_xmit_frame_ring() clear the TX buffer state on the drop path:

dev_kfree_skb_any(skb);
first->type = ICE_TX_BUF_EMPTY;

After the revert, first->skb is still recorded and first->type is still set to ICE_TX_BUF_SKB before ice_tso() / ice_tx_csum(), but the error path now only frees the skb and returns.

Later ice_clean_tx_ring() -> ice_unmap_and_free_tx_buf() still treats ICE_TX_BUF_SKB as owning a live skb and frees tx_buf->skb.

So its again the same issue coming back to stable.

I looked up the reason for the revert and the reason for the revert is we took a prerequisite for this which doesn't fit will so to revert the prerequisite we reverted this fix as well, I think we need adapted patch to older stable trees.

Quoted 4 lines

https://lore.kernel.org/all/[email protected]/

Nothing to do now but I think we need to add some sort TODO-backports list in stable-queue , thoughts ?

Sure, but ideally people would just send the missing backports :)

author maintainer
#48 lore raw

Re: [PATCH 6.12 041/272] i3c: mipi-i3c-hci: Correct RING_CTRL_ABORT handling in DMA dequeue

In reply to Harshit Mogalapalli
Quoted 146 lines · Harshit Mogalapalli
Quoted 145 lines · Harshit Mogalapalli

Hi Greg/Sasha,

Quoted 67 lines · Greg Kroah-Hartman

6.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Adrian Hunter <[email protected]>

[ Upstream commit b795e68bf3073d67bebbb5a44d93f49efc5b8cc7 ]

The logic used to abort the DMA ring contains several flaws:

  1. The driver unconditionally issues a ring abort even when the ring has
     already stopped.
  2. The completion used to wait for abort completion is never re-initialized, resulting in incorrect wait behavior.
  3. The abort sequence unintentionally clears RING_CTRL_ENABLE, which resets hardware ring pointers and disrupts the controller state.
  4. If the ring is already stopped, the abort operation should be considered successful without attempting further action.

Fix the abort handling by checking whether the ring is running before issuing an abort, re-initializing the completion when needed, ensuring that
RING_CTRL_ENABLE remains asserted during abort, and treating an already stopped ring as a successful condition.

Fixes 9ad9a52cce282 ("i3c/master: introduce the mipi-i3c-hci driver")

[email protected]

---
  drivers/i3c/master/mipi-i3c-hci/dma.c | 27 +++++++++++++++++----------

  1 file changed, 17 insertions(+), 10 deletions(-)
drivers/i3c/ renamed from drivers/i3c/master/mipi-i3c-hci/dma.c +0 -0

master/mipi-i3c-hci/dma.c
index b9496e8c4784d..44461f13b54cd 100644

drivers/i3c/master/mipi-i3c-hci/dma.c +7 -10
@@ -457,16 +457,23 @@ static bool hci_dma_dequeue_xfer(struct
 i3c_hci *hci,
       struct hci_rh_data *rh = &rings->headers[xfer_list[0].ring_number];
       unsigned int i;
       bool did_unqueue = false;
-
-    /* stop the ring */
-    rh_reg_write(RING_CONTROL, RING_CTRL_ABORT);
-    if (wait_for_completion_timeout(&rh->op_done, HZ) == 0) {
-        /*
-         * We're deep in it if ever this condition is ever met.
-         * Hardware might still be writing to memory, etc.
-         */
-        dev_crit(&hci->master.dev, "unable to abort the ring\n");
-        WARN_ON(1);
+    u32 ring_status;
+
+    ring_status = rh_reg_read(RING_STATUS);
+    if (ring_status & RING_STATUS_RUNNING) {
+        /* stop the ring */
+        reinit_completion(&rh->op_done);
+        rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_ABORT);

drivers/i3c/master/mipi-i3c-hci/dma.c static bool hci_dma_dequeue_xfer(struct · line 477

Quoted 10 lines
drivers/i3c/master/mipi-i3c-hci/dma.c +10 -0
+        wait_for_completion_timeout(&rh->op_done, HZ);
+        ring_status = rh_reg_read(RING_STATUS);
+        if (ring_status & RING_STATUS_RUNNING) {
+            /*
+             * We're deep in it if ever this condition is ever met.
+             * Hardware might still be writing to memory, etc.
+             */
+            dev_crit(&hci->master.dev, "unable to abort the ring\n");
+            WARN_ON(1);
+        }

I ran an AI-assisted backport review and checked the 6.12.y tree.

The posted backport adds the RING_CTRL_ABORT completion handling, including:

    reinit_completion(&rh->op_done); rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE | RING_CTRL_ABORT); wait_for_completion_timeout(&rh->op_done, HZ);

In upstream b795e68bf307, that path runs under hci->control_mutex, and the ring bookkeeping is also serialized with hci->lock.

drivers/i3c/master/mipi-i3c-hci/dma.c +11 -9
@@ -546,18 +546,25 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci,
         struct hci_rh_data *rh = &rings-
 >headers[xfer_list[0].ring_number];
         unsigned int i;
         bool did_unqueue = false;
+       u32 ring_status;
 
         guard(mutex)(&hci->control_mutex);
 
-       /* stop the ring */
-       rh_reg_write(RING_CONTROL, RING_CTRL_ABORT);
-       if (wait_for_completion_timeout(&rh->op_done, HZ) == 0) {
-               /*
-                * We're deep in it if ever this condition is ever met.
-                * Hardware might still be writing to memory, etc.
-                */
-               dev_crit(&hci->master.dev, "unable to abort the ring\n");
-               WARN_ON(1);
+       ring_status = rh_reg_read(RING_STATUS);
+       if (ring_status & RING_STATUS_RUNNING) {
+               /* stop the ring */
+               reinit_completion(&rh->op_done);
+               rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE |
 RING_CTRL_ABORT);
+               wait_for_completion_timeout(&rh->op_done, HZ);
+               ring_status = rh_reg_read(RING_STATUS);
+               if (ring_status & RING_STATUS_RUNNING) {
+                       /*
+                        * We're deep in it if ever this condition is

ever met.
+                        * Hardware might still be writing to memory, etc. +                        */
+                       dev_crit(&hci->master.dev, "unable to abort the ring\n");
+                       WARN_ON(1);
+               }
        }

        spin_lock_irq(&hci->lock);

Downstream 6.12.y has the new reinit_completion() path, but it still lacks the MIPI I3C HCI control_mutex and the IRQ/dequeue ring-state locking.

So the backport can reinitialize and wait on the shared ring completion while another timeout/dequeue or IRQ completion path is still touching the same transfer state. Thoughts ?

Quoted 6 lines
Quoted 2 lines

Maybe we should drop this for now and queue it up with its prerequisites together ?

Forgot to metnion, the prerequisites are 1dca8aee80ee ("i3c: mipi-i3c-hci:
Fix race in DMA ring dequeue") and f0b5159637ca ("i3c: mipi-i3c-hci: Fix race between DMA ring dequeue and interrupt handler")

I'll just drop it for now for all branches as I doubt anyone has i3c hardware on those old branches just yet (or if they do, they can send the needed backports...)

thanks,

greg k-h

#179 lore raw

Re: [PATCH 6.12 170/272] netfilter: x_tables: add and use xtables_unregister_table_exit

In reply to Greg Kroah-Hartman

Hi Greg/Sasha

Quoted 27 lines · Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Florian Westphal <[email protected]>

[ Upstream commit b4597d5fd7d2f8cebfffd40dffb5e003cc78964c ]

Previous change added xtables_unregister_table_pre_exit to detach the table from the packetpath and to unlink it from the active table list. In case of rmmod, userspace that is doing set/getsockopt for this table will not be able to re-instantiate the table:
1. The larval table has been removed already
2. existing instantiated table is no longer on the xt pernet table list.

This adds the second stage helper:

unlink the table from the dying list, free the hook ops (if any) and do the audit notification. It replaces xt_unregister_table().

....

Quoted 85 lines
  
  struct compat_delta {
net/netfilter/x_tables.c +41 -17
@@ -1522,23 +1525,6 @@ struct xt_table *xt_register_table(struct net *net,
  }
  EXPORT_SYMBOL_GPL(xt_register_table);
 
-void *xt_unregister_table(struct xt_table *table)
-{
-	struct xt_table_info *private;
-
-	mutex_lock(&xt[table->af].mutex);
-	private = table->private;
-	list_del(&table->list);
-	mutex_unlock(&xt[table->af].mutex);
-	audit_log_nfcfg(table->name, table->af, private->number,
-			AUDIT_XT_OP_UNREGISTER, GFP_KERNEL);
-	kfree(table->ops);
-	kfree(table);
-
-	return private;
-}
-EXPORT_SYMBOL_GPL(xt_unregister_table);
-
  /**
   * xt_unregister_table_pre_exit - pre-shutdown unregister of a table
   * @net: network namespace
@@ -1548,6 +1534,14 @@ EXPORT_SYMBOL_GPL(xt_unregister_table);
   * Unregisters the specified netfilter table from the given network namespace
   * and also unregisters the hooks from netfilter core: no new packets will be
   * processed.
+ *
+ * This must be called prior to xt_unregister_table_exit() from the pernet
+ * .pre_exit callback.  After this call, the table is no longer visible to
+ * the get/setsockopt path.  In case of rmmod, module exit path must have
+ * called xt_unregister_template() prior to unregistering pernet ops to
+ * prevent re-instantiation of the table.
+ *
+ * See also: xt_unregister_table_exit()
   */
  void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name)
  {
@@ -1557,6 +1551,7 @@ void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name)
  	mutex_lock(&xt[af].mutex);
  	list_for_each_entry(t, &xt_net->tables[af], list) {
  		if (strcmp(t->name, name) == 0) {
+			list_move(&t->list, &xt_net->dead_tables[af]);
  			mutex_unlock(&xt[af].mutex);
 
  			if (t->ops) /* nat table registers with nat core, t->ops is NULL. */
@@ -1567,6 +1562,50 @@ void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name)
  	mutex_unlock(&xt[af].mutex);
  }
  EXPORT_SYMBOL(xt_unregister_table_pre_exit);
+
+/**
+ * xt_unregister_table_exit - remove a table during namespace teardown
+ * @net: the network namespace from which to unregister the table
+ * @af: address family (e.g., NFPROTO_IPV4, NFPROTO_IPV6)
+ * @name: name of the table to unregister
+ *
+ * Completes the unregister process for a table. This must be called from
+ * the pernet ops .exit callback. This is the second stage after
+ * xt_unregister_table_pre_exit().
+ *
+ * pair with xt_unregister_table_pre_exit() during namespace shutdown.
+ *
+ * Return: the unregistered table or NULL if the table was never
+ *         instantiated. The caller needs to kfree() the table after it
+ *         has removed the family specific matches/targets.
+ */
+struct xt_table *xt_unregister_table_exit(struct net *net, u8 af, const char *name)
+{
+	struct xt_pernet *xt_net = net_generic(net, xt_pernet_id);
+	struct xt_table *table;
+
+	mutex_lock(&xt[af].mutex);
+	list_for_each_entry(table, &xt_net->dead_tables[af], list) {
+		struct nf_hook_ops *ops = NULL;
+
+		if (strcmp(table->name, name) != 0)
+			continue;
+
+		list_del(&table->list);
+
+		audit_log_nfcfg(table->name, table->af, table->private->number,

net/netfilter/x_tables.c void xt_unregister_table_pre_exit(struct net *net, u8 af, const char *name) · line 1606

Quoted 10 lines
net/netfilter/x_tables.c +10 -0
+				AUDIT_XT_OP_UNREGISTER, GFP_KERNEL);
+		swap(table->ops, ops);
+		mutex_unlock(&xt[af].mutex);
+
+		kfree(ops);
+		return table;
+	}
+	mutex_unlock(&xt[af].mutex);
+
+	return NULL;

Apart from a different concern I raised here:

https://lore.kernel.org/all/[email protected]/

I ran an AI-assisted backport review and checked the x_tables state in 6.12.y: and the analysis goes like this:

This backports the upstream unregister-side split from b4597d5fd7d2f8 without the upstream registration-side prerequisite commit: b62eb8dcf2c4 ("netfilter: x_tables: allocate hook ops while under mutex")

Upstream builds this patch on top of b62eb8dcf2c4 ("netfilter: x_tables: allocate hook ops while under mutex"). With that prerequisite, hook allocation and nf_register_net_hooks() happen inside xt_register_table(), before the table is linked on the active list, and the failure path includes the needed RCU handling.

Current 6.12.y still has the older model: ip_tables/ip6_tables/arp_tables call xt_register_table() first, then allocate/register hooks in family code. If nf_register_net_hooks() fails, the path goes to __ipt_unregister_table() or the equivalent helper, which now only frees the table object which also means the backport can free a table that was already linked on xt_net->tables[]

So i think we should drop this whole netfiler / x_tables series and think through w a better way to backport the race fixes.

Thanks,
Harshit

Quoted 29 lines
net/netfilter/x_tables.c +8 -2
+}
+EXPORT_SYMBOL_GPL(xt_unregister_table_exit);
  #endif
 
  #ifdef CONFIG_PROC_FS
@@ -2013,8 +2052,10 @@ static int __net_init xt_net_init(struct net *net)
  	struct xt_pernet *xt_net = net_generic(net, xt_pernet_id);
  	int i;
 
-	for (i = 0; i < NFPROTO_NUMPROTO; i++)
+	for (i = 0; i < NFPROTO_NUMPROTO; i++) {
  		INIT_LIST_HEAD(&xt_net->tables[i]);
+		INIT_LIST_HEAD(&xt_net->dead_tables[i]);
+	}
  	return 0;
  }
 
@@ -2023,8 +2064,10 @@ static void __net_exit xt_net_exit(struct net *net)
  	struct xt_pernet *xt_net = net_generic(net, xt_pernet_id);
  	int i;
 
-	for (i = 0; i < NFPROTO_NUMPROTO; i++)
+	for (i = 0; i < NFPROTO_NUMPROTO; i++) {
  		WARN_ON_ONCE(!list_empty(&xt_net->tables[i]));
+		WARN_ON_ONCE(!list_empty(&xt_net->dead_tables[i]));
+	}
  }
 
  static struct pernet_operations xt_net_ops = {
#188 lore raw

Re: [PATCH 6.12 178/272] ice: fix setting RSS VSI hash for E830

In reply to Greg Kroah-Hartman

Hi Greg/Sasha,

Quoted 44 lines · Greg Kroah-Hartman

6.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Marcin Szycik <[email protected]>

[ Upstream commit b3cda96feb60d91fe88d52b974ff110dcfa91239 ]

ice_set_rss_hfunc() performs a VSI update, in which it sets hashing function, leaving other VSI options unchanged. However, ::q_opt_flags is mistakenly set to the value of another field, instead of its original value, probably due to a typo. What happens next is hardware-dependent:

On E810, only the first bit is meaningful (see ICE_AQ_VSI_Q_OPT_PE_FLTR_EN) and can potentially end up in a different state than before VSI update.

On E830, some of the remaining bits are not reserved. Setting them to some unrelated values can cause the firmware to reject the update because of invalid settings, or worse - succeed.

Reproducer:
sudo ethtool -X $PF1 equal 8

Output in dmesg:
Failed to configure RSS hash for VSI 6, error -5

---
  drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_main.c +0 -0
index 2a629b9a9e03a..664bedfbd8054 100644

drivers/net/ethernet/intel/ice/ice_main.c int ice_set_rss_hfunc(struct ice_vsi *vsi, u8 hfunc) · line 8112

Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_main.c +1 -1
@@ -8108,7 +8108,7 @@ int ice_set_rss_hfunc(struct ice_vsi *vsi, u8 hfunc)
  	ctx->info.q_opt_rss |=
  		FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_HASH_M, hfunc);
  	ctx->info.q_opt_tc = vsi->info.q_opt_tc;
-	ctx->info.q_opt_flags = vsi->info.q_opt_rss;
+	ctx->info.q_opt_flags = vsi->info.q_opt_flags;
 

I ran an AI-assisted backport review and checked this against the 6.12.y ice driver. I think the E830 RSS fix is incomplete on this branch.

The backport fixed the PF path in ice_main.c, so 6.12.y now has:

ctx->info.q_opt_flags = vsi->info.q_opt_flags;

But 6.12.y still has the older VF virtchnl RSS path in ice_virtchnl.c, and that path still does:

ctx->info.q_opt_flags = vsi->info.q_opt_rss;

Upstream has newer VF helper in virt/rss.c preserves q_opt_flags as well, but that helper/refactor is not present in this 6.12.y tree.

See commit: 3a6d87e2eaac ("ice: implement GTP RSS context tracking and configuration") which is not yet in 6.12.y

I think 6.12.y needs the equivalent one-line fix in drivers/net/ethernet/intel/ice/ice_virtchnl.c, changing q_opt_flags to preserve vsi->info.q_opt_flags there too. Thoughts?

Maybe lets drop this and backport it again ?

thanks,
Harshit

Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_main.c +0 -0
  	err = ice_update_vsi(hw, vsi->idx, ctx, NULL);
  	if (err) {
#189 lore raw

Re: [PATCH 6.12 178/272] ice: fix setting RSS VSI hash for E830

Quoted 75 lines · Harshit Mogalapalli

Hi Greg/Sasha,

Quoted 49 lines · Greg Kroah-Hartman

6.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marcin Szycik <[email protected]>

[ Upstream commit b3cda96feb60d91fe88d52b974ff110dcfa91239 ]

ice_set_rss_hfunc() performs a VSI update, in which it sets hashing function, leaving other VSI options unchanged. However, ::q_opt_flags is mistakenly set to the value of another field, instead of its original value, probably due to a typo. What happens next is hardware-dependent:

On E810, only the first bit is meaningful (see ICE_AQ_VSI_Q_OPT_PE_FLTR_EN) and can potentially end up in a different state than before VSI update.

On E830, some of the remaining bits are not reserved. Setting them to some unrelated values can cause the firmware to reject the update because of invalid settings, or worse - succeed.

Reproducer:
   sudo ethtool -X $PF1 equal 8

Output in dmesg:
   Failed to configure RSS hash for VSI 6, error -5

Fixes 352e9bf23813 ("ice: enable symmetric-xor RSS for Toeplitz hash

function")

[email protected]

---
  drivers/net/ethernet/intel/ice/ice_main.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ renamed from drivers/net/ethernet/intel/ice/ice_main.c +0 -0

ethernet/intel/ice/ice_main.c
index 2a629b9a9e03a..664bedfbd8054 100644

drivers/net/ethernet/intel/ice/ice_main.c +0 -0
@@ -8108,7 +8108,7 @@ int ice_set_rss_hfunc(struct ice_vsi *vsi, u8
 hfunc)
Quoted 6 lines

      ctx->info.q_opt_rss |= FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_HASH_M, hfunc); ctx->info.q_opt_tc = vsi->info.q_opt_tc;
-    ctx->info.q_opt_flags = vsi->info.q_opt_rss; +    ctx->info.q_opt_flags = vsi->info.q_opt_flags;

I ran an AI-assisted backport review and checked this against the 6.12.y ice driver. I think the E830 RSS fix is incomplete on this branch.

The backport fixed the PF path in ice_main.c, so 6.12.y now has:

ctx->info.q_opt_flags = vsi->info.q_opt_flags;

But 6.12.y still has the older VF virtchnl RSS path in ice_virtchnl.c, and that path still does:

ctx->info.q_opt_flags = vsi->info.q_opt_rss;

Upstream has newer VF helper in virt/rss.c preserves q_opt_flags as well, but that helper/refactor is not present in this 6.12.y tree.

Quoted 9 lines

See commit: 3a6d87e2eaac ("ice: implement GTP RSS context tracking and configuration") which is not yet in 6.12.y

I think 6.12.y needs the equivalent one-line fix in drivers/net/ ethernet/intel/ice/ice_virtchnl.c, changing q_opt_flags to preserve vsi-

Quoted 1 line

info.q_opt_flags there too. Thoughts?

Maybe lets drop this and backport it again ?

I think you're correct that this won't fully resolve the issue.

Quoted 6 lines

thanks,
Harshit

Quoted 2 lines

      err = ice_update_vsi(hw, vsi->idx, ctx, NULL); if (err) {

#190 lore raw

Re: [PATCH 6.12 178/272] ice: fix setting RSS VSI hash for E830

Quoted 79 lines · Jacob Keller
Quoted 78 lines · Harshit Mogalapalli

Hi Greg/Sasha,

Quoted 49 lines · Greg Kroah-Hartman

6.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marcin Szycik <[email protected]>

[ Upstream commit b3cda96feb60d91fe88d52b974ff110dcfa91239 ]

ice_set_rss_hfunc() performs a VSI update, in which it sets hashing function, leaving other VSI options unchanged. However, ::q_opt_flags is mistakenly set to the value of another field, instead of its original value, probably due to a typo. What happens next is hardware-dependent:

On E810, only the first bit is meaningful (see ICE_AQ_VSI_Q_OPT_PE_FLTR_EN) and can potentially end up in a different state than before VSI update.

On E830, some of the remaining bits are not reserved. Setting them to some unrelated values can cause the firmware to reject the update because of invalid settings, or worse - succeed.

Reproducer:
   sudo ethtool -X $PF1 equal 8

Output in dmesg:
   Failed to configure RSS hash for VSI 6, error -5

Fixes 352e9bf23813 ("ice: enable symmetric-xor RSS for Toeplitz hash

function")

[email protected]

---
  drivers/net/ethernet/intel/ice/ice_main.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ renamed from drivers/net/ethernet/intel/ice/ice_main.c +0 -0

ethernet/intel/ice/ice_main.c
index 2a629b9a9e03a..664bedfbd8054 100644

drivers/net/ethernet/intel/ice/ice_main.c +0 -0
@@ -8108,7 +8108,7 @@ int ice_set_rss_hfunc(struct ice_vsi *vsi, u8
 hfunc)
Quoted 6 lines

      ctx->info.q_opt_rss |= FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_HASH_M, hfunc); ctx->info.q_opt_tc = vsi->info.q_opt_tc;
-    ctx->info.q_opt_flags = vsi->info.q_opt_rss; +    ctx->info.q_opt_flags = vsi->info.q_opt_flags;

I ran an AI-assisted backport review and checked this against the 6.12.y ice driver. I think the E830 RSS fix is incomplete on this branch.

The backport fixed the PF path in ice_main.c, so 6.12.y now has:

ctx->info.q_opt_flags = vsi->info.q_opt_flags;

But 6.12.y still has the older VF virtchnl RSS path in ice_virtchnl.c, and that path still does:

ctx->info.q_opt_flags = vsi->info.q_opt_rss;

Upstream has newer VF helper in virt/rss.c preserves q_opt_flags as well, but that helper/refactor is not present in this 6.12.y tree.

See commit: 3a6d87e2eaac ("ice: implement GTP RSS context tracking and configuration") which is not yet in 6.12.y

Quoted 8 lines
Quoted 6 lines

I think 6.12.y needs the equivalent one-line fix in drivers/net/ ethernet/intel/ice/ice_virtchnl.c, changing q_opt_flags to preserve vsi-

Quoted 1 line

info.q_opt_flags there too. Thoughts?

Maybe lets drop this and backport it again ?

I think you're correct that this won't fully resolve the issue.

Hi,

I didn't submit a followup fix for 6.12 as per [1]:

Quoted 3 lines

No “This could be a problem...” type of things like a “theoretical race condition”, unless an explanation of how the bug can be exploited is also provided.

because I didn't manage to break it. Should I submit it to stable anyway? Also, as stated above, commit 3a6d87e2eaac accidentally fixed it in modern versions.

Thanks,
Marcin

[1] https://docs.kernel.org/process/stable-kernel-rules.html

#285 lore raw

PATCH 1/1 selftests/landlock: Add missing connect(minimal AF_UNSPEC) test

In reply to Greg Kroah-Hartman

From: Matthieu Buffet <[email protected]>

[ Upstream commit 6685201ebfacff0c889bcd569181fa6e8af5575e ]

connect_variant(unspec_any0) is called twice. Both calls end up in connect_variant_addrlen() with an address length of get_addrlen(minimal=false).
However, the connect() syscall and its variants (e.g. iouring/compat) accept much shorter addresses of 4 bytes and that behaviour was not tested.

Replace one of these calls with one using a minimal address length (just a bare sa_family=AF_UNSPEC field with no actual address). Also add a call using a truncated address for good measure.

---
 tools/testing/selftests/landlock/net_test.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
tools/testing/selftests/landlock/net_test.c +13 -1
index 897131bc8a13..d3cb27e24a16 100644
@@ -905,7 +905,19 @@ TEST_F(protocol, connect_unspec)
 			EXPECT_EQ(0, close(ruleset_fd));
 		}
 
-		ret = connect_variant(connect_fd, &self->unspec_any0);
+		/* Try to re-disconnect with a truncated address struct. */
+		EXPECT_EQ(-EINVAL,
+			  connect_variant_addrlen(
+				  connect_fd, &self->unspec_any0,
+				  get_addrlen(&self->unspec_any0, true) - 1));
+
+		/*
+		 * Re-disconnect, with a minimal sockaddr struct (just a
+		 * bare af_family=AF_UNSPEC field).
+		 */
+		ret = connect_variant_addrlen(connect_fd, &self->unspec_any0,
+					      get_addrlen(&self->unspec_any0,
+							  true));
 		if (self->srv0.protocol.domain == AF_UNIX &&
 		    self->srv0.protocol.type == SOCK_STREAM) {
 			EXPECT_EQ(-EINVAL, ret);
maintainer Applied
#286 lore raw

Re: [PATCH 6.12.y] selftests/landlock: Add missing connect(minimal AF_UNSPEC) test

Quoted 5 lines

[ Upstream commit 6685201ebfacff0c889bcd569181fa6e8af5575e ]

connect_variant(unspec_any0) is called twice. Both calls end up in connect_variant_addrlen() with an address length of get_addrlen(minimal=false).

Queued for 6.18 and 6.12, thanks.

Signature · 2 lines
Thanks,
Sasha