]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.12-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Dec 2025 10:26:59 +0000 (11:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Dec 2025 10:26:59 +0000 (11:26 +0100)
added patches:
loongarch-add-machine_kexec_mask_interrupts-implementation.patch
net-dst-introduce-dst-dev_rcu.patch
net-lan743x-allocate-rings-outside-zone_dma.patch
tcp_metrics-use-dst_dev_net_rcu.patch

queue-6.12/loongarch-add-machine_kexec_mask_interrupts-implementation.patch [new file with mode: 0644]
queue-6.12/net-dst-introduce-dst-dev_rcu.patch [new file with mode: 0644]
queue-6.12/net-lan743x-allocate-rings-outside-zone_dma.patch [new file with mode: 0644]
queue-6.12/series
queue-6.12/tcp_metrics-use-dst_dev_net_rcu.patch [new file with mode: 0644]

diff --git a/queue-6.12/loongarch-add-machine_kexec_mask_interrupts-implementation.patch b/queue-6.12/loongarch-add-machine_kexec_mask_interrupts-implementation.patch
new file mode 100644 (file)
index 0000000..507c10a
--- /dev/null
@@ -0,0 +1,53 @@
+From chenhuacai@loongson.cn  Tue Dec 16 11:19:39 2025
+From: Huacai Chen <chenhuacai@loongson.cn>
+Date: Sat, 13 Dec 2025 17:49:50 +0800
+Subject: [PATCH 6.12] LoongArch: Add machine_kexec_mask_interrupts() implementation
+To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>, Huacai Chen <chenhuacai@kernel.org>
+Cc: Xuerui Wang <kernel@xen0n.name>, stable@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Huacai Chen <chenhuacai@loongson.cn>, Tianyang Zhang <zhangtianyang@loongson.cn>
+Message-ID: <20251213094950.1068951-1-chenhuacai@loongson.cn>
+
+From: Huacai Chen <chenhuacai@loongson.cn>
+
+Commit 863a320dc6fd7c855f47da4b ("LoongArch: Mask all interrupts during
+kexec/kdump") is backported to LTS branches, but they lack a generic
+machine_kexec_mask_interrupts() implementation, so add an arch-specific
+one.
+
+Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn>
+Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/loongarch/kernel/machine_kexec.c |   22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+--- a/arch/loongarch/kernel/machine_kexec.c
++++ b/arch/loongarch/kernel/machine_kexec.c
+@@ -136,6 +136,28 @@ void kexec_reboot(void)
+       BUG();
+ }
++static void machine_kexec_mask_interrupts(void)
++{
++      unsigned int i;
++      struct irq_desc *desc;
++
++      for_each_irq_desc(i, desc) {
++              struct irq_chip *chip;
++
++              chip = irq_desc_get_chip(desc);
++              if (!chip)
++                      continue;
++
++              if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
++                      chip->irq_eoi(&desc->irq_data);
++
++              if (chip->irq_mask)
++                      chip->irq_mask(&desc->irq_data);
++
++              if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
++                      chip->irq_disable(&desc->irq_data);
++      }
++}
+ #ifdef CONFIG_SMP
+ static void kexec_shutdown_secondary(void *regs)
diff --git a/queue-6.12/net-dst-introduce-dst-dev_rcu.patch b/queue-6.12/net-dst-introduce-dst-dev_rcu.patch
new file mode 100644 (file)
index 0000000..0295e5f
--- /dev/null
@@ -0,0 +1,107 @@
+From stable+bounces-201116-greg=kroah.com@vger.kernel.org Mon Dec 15 22:56:13 2025
+From: Gyokhan Kochmarla <gyokhan@amazon.de>
+Date: Mon, 15 Dec 2025 21:51:18 +0000
+Subject: net: dst: introduce dst->dev_rcu
+To: <stable@vger.kernel.org>
+Cc: <edumazet@google.com>, <davem@davemloft.net>, <dsahern@kernel.org>, <kuba@kernel.org>, <pabeni@redhat.com>, <linux@gyokhan.com>, <netdev@vger.kernel.org>, <horms@kernel.org>, <linux-kernel@vger.kernel.org>
+Message-ID: <20251215215119.63681-2-gyokhan@amazon.de>
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit caedcc5b6df1b2e2b5f39079e3369c1d4d5c5f50 ]
+
+Followup of commit 88fe14253e1818 ("net: dst: add four helpers
+to annotate data-races around dst->dev").
+
+We want to gradually add explicit RCU protection to dst->dev,
+including lockdep support.
+
+Add an union to alias dst->dev_rcu and dst->dev.
+
+Add dst_dev_net_rcu() helper.
+
+Fixes: 4a6ce2b6f2ec ("net: introduce a new function dst_dev_put()")
+Cc: stable@vger.kernel.org
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Reviewed-by: David Ahern <dsahern@kernel.org>
+Link: https://patch.msgid.link/20250828195823.3958522-2-edumazet@google.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Stable-dep-of: 50c127a69cd62 ("Replace three dst_dev() with a lockdep enabled helper.")
+Signed-off-by: Gyokhan Kochmarla <gyokhan@amazon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/net/dst.h |   16 +++++++++++-----
+ net/core/dst.c    |    2 +-
+ net/ipv4/route.c  |    4 ++--
+ 3 files changed, 14 insertions(+), 8 deletions(-)
+
+--- a/include/net/dst.h
++++ b/include/net/dst.h
+@@ -24,7 +24,10 @@
+ struct sk_buff;
+ struct dst_entry {
+-      struct net_device       *dev;
++      union {
++              struct net_device       *dev;
++              struct net_device __rcu *dev_rcu;
++      };
+       struct  dst_ops         *ops;
+       unsigned long           _metrics;
+       unsigned long           expires;
+@@ -568,9 +571,12 @@ static inline struct net_device *dst_dev
+ static inline struct net_device *dst_dev_rcu(const struct dst_entry *dst)
+ {
+-      /* In the future, use rcu_dereference(dst->dev) */
+-      WARN_ON_ONCE(!rcu_read_lock_held());
+-      return READ_ONCE(dst->dev);
++      return rcu_dereference(dst->dev_rcu);
++}
++
++static inline struct net *dst_dev_net_rcu(const struct dst_entry *dst)
++{
++      return dev_net_rcu(dst_dev_rcu(dst));
+ }
+ static inline struct net_device *skb_dst_dev(const struct sk_buff *skb)
+@@ -590,7 +596,7 @@ static inline struct net *skb_dst_dev_ne
+ static inline struct net *skb_dst_dev_net_rcu(const struct sk_buff *skb)
+ {
+-      return dev_net_rcu(skb_dst_dev(skb));
++      return dev_net_rcu(skb_dst_dev_rcu(skb));
+ }
+ struct dst_entry *dst_blackhole_check(struct dst_entry *dst, u32 cookie);
+--- a/net/core/dst.c
++++ b/net/core/dst.c
+@@ -150,7 +150,7 @@ void dst_dev_put(struct dst_entry *dst)
+               dst->ops->ifdown(dst, dev);
+       WRITE_ONCE(dst->input, dst_discard);
+       WRITE_ONCE(dst->output, dst_discard_out);
+-      WRITE_ONCE(dst->dev, blackhole_netdev);
++      rcu_assign_pointer(dst->dev_rcu, blackhole_netdev);
+       netdev_ref_replace(dev, blackhole_netdev, &dst->dev_tracker,
+                          GFP_ATOMIC);
+ }
+--- a/net/ipv4/route.c
++++ b/net/ipv4/route.c
+@@ -1030,7 +1030,7 @@ static void __ip_rt_update_pmtu(struct r
+               return;
+       rcu_read_lock();
+-      net = dev_net_rcu(dst_dev(dst));
++      net = dst_dev_net_rcu(dst);
+       if (mtu < net->ipv4.ip_rt_min_pmtu) {
+               lock = true;
+               mtu = min(old_mtu, net->ipv4.ip_rt_min_pmtu);
+@@ -1328,7 +1328,7 @@ static unsigned int ipv4_default_advmss(
+       struct net *net;
+       rcu_read_lock();
+-      net = dev_net_rcu(dst_dev(dst));
++      net = dst_dev_net_rcu(dst);
+       advmss = max_t(unsigned int, ipv4_mtu(dst) - header_size,
+                                  net->ipv4.ip_rt_min_advmss);
+       rcu_read_unlock();
diff --git a/queue-6.12/net-lan743x-allocate-rings-outside-zone_dma.patch b/queue-6.12/net-lan743x-allocate-rings-outside-zone_dma.patch
new file mode 100644 (file)
index 0000000..a9b8542
--- /dev/null
@@ -0,0 +1,36 @@
+From 8a8f3f4991761a70834fe6719d09e9fd338a766e Mon Sep 17 00:00:00 2001
+From: Thangaraj Samynathan <thangaraj.s@microchip.com>
+Date: Tue, 15 Apr 2025 10:15:09 +0530
+Subject: net: lan743x: Allocate rings outside ZONE_DMA
+
+From: Thangaraj Samynathan <thangaraj.s@microchip.com>
+
+commit 8a8f3f4991761a70834fe6719d09e9fd338a766e upstream.
+
+The driver allocates ring elements using GFP_DMA flags. There is
+no dependency from LAN743x hardware on memory allocation should be
+in DMA_ZONE. Hence modifying the flags to use only GFP_ATOMIC. This
+is consistent with other callers of lan743x_rx_init_ring_element().
+
+Reported-by: Zhang, Liyin(CN) <Liyin.Zhang.CN@windriver.com>
+Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
+Reviewed-by: Simon Horman <horms@kernel.org>
+Link: https://patch.msgid.link/20250415044509.6695-1-thangaraj.s@microchip.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/microchip/lan743x_main.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/microchip/lan743x_main.c
++++ b/drivers/net/ethernet/microchip/lan743x_main.c
+@@ -2494,8 +2494,7 @@ static int lan743x_rx_process_buffer(str
+       /* save existing skb, allocate new skb and map to dma */
+       skb = buffer_info->skb;
+-      if (lan743x_rx_init_ring_element(rx, rx->last_head,
+-                                       GFP_ATOMIC | GFP_DMA)) {
++      if (lan743x_rx_init_ring_element(rx, rx->last_head, GFP_ATOMIC)) {
+               /* failed to allocate next skb.
+                * Memory is very low.
+                * Drop this packet and reuse buffer.
index 31521f090c5ae53b3d373e48f80adda285e0ab68..ed0902f777000171506e8db501ed7843c7d6ad2d 100644 (file)
@@ -343,3 +343,7 @@ efi-cper-align-arm-cper-type-with-uefi-2.9a-2.10-spe.patch
 scsi-imm-fix-use-after-free-bug-caused-by-unfinished.patch
 irqchip-mchp-eic-fix-error-code-in-mchp_eic_domain_a.patch
 ocfs2-fix-memory-leak-in-ocfs2_merge_rec_left.patch
+loongarch-add-machine_kexec_mask_interrupts-implementation.patch
+net-lan743x-allocate-rings-outside-zone_dma.patch
+net-dst-introduce-dst-dev_rcu.patch
+tcp_metrics-use-dst_dev_net_rcu.patch
diff --git a/queue-6.12/tcp_metrics-use-dst_dev_net_rcu.patch b/queue-6.12/tcp_metrics-use-dst_dev_net_rcu.patch
new file mode 100644 (file)
index 0000000..f9eb309
--- /dev/null
@@ -0,0 +1,55 @@
+From stable+bounces-201117-greg=kroah.com@vger.kernel.org Mon Dec 15 22:53:23 2025
+From: Gyokhan Kochmarla <gyokhan@amazon.de>
+Date: Mon, 15 Dec 2025 21:51:19 +0000
+Subject: tcp_metrics: use dst_dev_net_rcu()
+To: <stable@vger.kernel.org>
+Cc: <edumazet@google.com>, <davem@davemloft.net>, <dsahern@kernel.org>, <kuba@kernel.org>, <pabeni@redhat.com>, <linux@gyokhan.com>, <netdev@vger.kernel.org>, <horms@kernel.org>, <linux-kernel@vger.kernel.org>
+Message-ID: <20251215215119.63681-3-gyokhan@amazon.de>
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 50c127a69cd6285300931853b352a1918cfa180f ]
+
+Replace three dst_dev() with a lockdep enabled helper.
+
+Fixes: 4a6ce2b6f2ec ("net: introduce a new function dst_dev_put()")
+Cc: stable@vger.kernel.org
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Reviewed-by: David Ahern <dsahern@kernel.org>
+Link: https://patch.msgid.link/20250828195823.3958522-7-edumazet@google.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Gyokhan Kochmarla <gyokhan@amazon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/tcp_metrics.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/net/ipv4/tcp_metrics.c
++++ b/net/ipv4/tcp_metrics.c
+@@ -170,7 +170,7 @@ static struct tcp_metrics_block *tcpm_ne
+       struct net *net;
+       spin_lock_bh(&tcp_metrics_lock);
+-      net = dev_net_rcu(dst_dev(dst));
++      net = dst_dev_net_rcu(dst);
+       /* While waiting for the spin-lock the cache might have been populated
+        * with this entry and so we have to check again.
+@@ -273,7 +273,7 @@ static struct tcp_metrics_block *__tcp_g
+               return NULL;
+       }
+-      net = dev_net_rcu(dst_dev(dst));
++      net = dst_dev_net_rcu(dst);
+       hash ^= net_hash_mix(net);
+       hash = hash_32(hash, tcp_metrics_hash_log);
+@@ -318,7 +318,7 @@ static struct tcp_metrics_block *tcp_get
+       else
+               return NULL;
+-      net = dev_net_rcu(dst_dev(dst));
++      net = dst_dev_net_rcu(dst);
+       hash ^= net_hash_mix(net);
+       hash = hash_32(hash, tcp_metrics_hash_log);