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

diff --git a/queue-5.4/rdma-core-rate-limit-gid-cache-warning-messages.patch b/queue-5.4/rdma-core-rate-limit-gid-cache-warning-messages.patch
new file mode 100644 (file)
index 0000000..8b99e9a
--- /dev/null
@@ -0,0 +1,44 @@
+From b2f37c5866ca9203e956b7fed9917ab068841baa 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 7affe6b4ae210..641e537a0069a 100644
+--- a/drivers/infiniband/core/cache.c
++++ b/drivers/infiniband/core/cache.c
+@@ -578,8 +578,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.4/regulator-core-fix-null-dereference-on-unbind-due-to.patch b/queue-5.4/regulator-core-fix-null-dereference-on-unbind-due-to.patch
new file mode 100644 (file)
index 0000000..edcda28
--- /dev/null
@@ -0,0 +1,44 @@
+From 2aa2f25c1e0c5a8de2db78c127a5be97f4f2b814 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 a01a769b2f2d1..e5ce97dc32158 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -5062,6 +5062,7 @@ static void regulator_remove_coupling(struct regulator_dev *rdev)
+                                err);
+       }
++      rdev->coupling_desc.n_coupled = 0;
+       kfree(rdev->coupling_desc.coupled_rdevs);
+       rdev->coupling_desc.coupled_rdevs = NULL;
+ }
+-- 
+2.39.5
+
index 05a8f9e202adb74b251577ff13fafec4781e6f32..9b5cb59fd494fdff9181af1252343941aade435a 100644 (file)
@@ -52,3 +52,5 @@ net_sched-sch_sfq-use-a-temporary-work-area-for-validating-configuration.patch
 net_sched-sch_sfq-move-the-limit-validation.patch
 net_sched-sch_sfq-reject-invalid-perturb-period.patch
 usb-hub-fix-detection-of-high-tier-usb3-devices-behind-suspended-hubs.patch
+regulator-core-fix-null-dereference-on-unbind-due-to.patch
+rdma-core-rate-limit-gid-cache-warning-messages.patch