]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Thu, 24 Jul 2025 14:15:07 +0000 (10:15 -0400)
committerSasha Levin <sashal@kernel.org>
Thu, 24 Jul 2025 14:15:07 +0000 (10:15 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/rdma-core-rate-limit-gid-cache-warning-messages.patch [new file with mode: 0644]
queue-5.10/regulator-core-fix-null-dereference-on-unbind-due-to.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/rdma-core-rate-limit-gid-cache-warning-messages.patch b/queue-5.10/rdma-core-rate-limit-gid-cache-warning-messages.patch
new file mode 100644 (file)
index 0000000..db002fc
--- /dev/null
@@ -0,0 +1,44 @@
+From c1dafe8c5321204ed813b3b7477af220c76840b2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 16 Jun 2025 11:26:21 +0300
+Subject: RDMA/core: Rate limit GID cache warning messages
+
+From: Maor Gottlieb <maorg@nvidia.com>
+
+[ Upstream commit 333e4d79316c9ed5877d7aac8b8ed22efc74e96d ]
+
+The GID cache warning messages can flood the kernel log when there are
+multiple failed attempts to add GIDs. This can happen when creating many
+virtual interfaces without having enough space for their GIDs in the GID
+table.
+
+Change pr_warn to pr_warn_ratelimited to prevent log flooding while still
+maintaining visibility of the issue.
+
+Link: https://patch.msgid.link/r/fd45ed4a1078e743f498b234c3ae816610ba1b18.1750062357.git.leon@kernel.org
+Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
+Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/core/cache.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
+index 7989b7e1d1c04..2bd9fb3195f5e 100644
+--- a/drivers/infiniband/core/cache.c
++++ b/drivers/infiniband/core/cache.c
+@@ -582,8 +582,8 @@ static int __ib_cache_gid_add(struct ib_device *ib_dev, u8 port,
+ out_unlock:
+       mutex_unlock(&table->lock);
+       if (ret)
+-              pr_warn("%s: unable to add gid %pI6 error=%d\n",
+-                      __func__, gid->raw, ret);
++              pr_warn_ratelimited("%s: unable to add gid %pI6 error=%d\n",
++                                  __func__, gid->raw, ret);
+       return ret;
+ }
+-- 
+2.39.5
+
diff --git a/queue-5.10/regulator-core-fix-null-dereference-on-unbind-due-to.patch b/queue-5.10/regulator-core-fix-null-dereference-on-unbind-due-to.patch
new file mode 100644 (file)
index 0000000..17b5794
--- /dev/null
@@ -0,0 +1,44 @@
+From 33c261ae5ecdaf81da470c4761464c6fbf7488e2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 26 Jun 2025 08:38:09 +0000
+Subject: regulator: core: fix NULL dereference on unbind due to stale coupling
+ data
+
+From: Alessandro Carminati <acarmina@redhat.com>
+
+[ Upstream commit ca46946a482238b0cdea459fb82fc837fb36260e ]
+
+Failing to reset coupling_desc.n_coupled after freeing coupled_rdevs can
+lead to NULL pointer dereference when regulators are accessed post-unbind.
+
+This can happen during runtime PM or other regulator operations that rely
+on coupling metadata.
+
+For example, on ridesx4, unbinding the 'reg-dummy' platform device triggers
+a panic in regulator_lock_recursive() due to stale coupling state.
+
+Ensure n_coupled is set to 0 to prevent access to invalid pointers.
+
+Signed-off-by: Alessandro Carminati <acarmina@redhat.com>
+Link: https://patch.msgid.link/20250626083809.314842-1-acarmina@redhat.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/regulator/core.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index a0cc907a76c18..b2d866d606512 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -5198,6 +5198,7 @@ static void regulator_remove_coupling(struct regulator_dev *rdev)
+                                ERR_PTR(err));
+       }
++      rdev->coupling_desc.n_coupled = 0;
+       kfree(rdev->coupling_desc.coupled_rdevs);
+       rdev->coupling_desc.coupled_rdevs = NULL;
+ }
+-- 
+2.39.5
+
index f1a0b560b47ba94b3add7ee310eafe7cdfb29d0a..5082cf9498c2c3d3cecf065b7977d7c0f2684e5d 100644 (file)
@@ -52,3 +52,5 @@ asoc-fsl_sai-force-a-software-reset-when-starting-in-consumer-mode.patch
 mm-vmalloc-leave-lazy-mmu-mode-on-pte-mapping-error.patch
 virtio-net-ensure-the-received-length-does-not-exceed-allocated-size.patch
 xhci-disable-stream-for-xhc-controller-with-xhci_broken_streams.patch
+regulator-core-fix-null-dereference-on-unbind-due-to.patch
+rdma-core-rate-limit-gid-cache-warning-messages.patch