From: Sasha Levin Date: Thu, 24 Jul 2025 14:15:08 +0000 (-0400) Subject: Fixes for 5.4 X-Git-Tag: v6.6.101~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6864e8d1d2bebe1b3eb3b4bd17a6d3dd0be6d07;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- 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 index 0000000000..8b99e9ad37 --- /dev/null +++ b/queue-5.4/rdma-core-rate-limit-gid-cache-warning-messages.patch @@ -0,0 +1,44 @@ +From b2f37c5866ca9203e956b7fed9917ab068841baa Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Jun 2025 11:26:21 +0300 +Subject: RDMA/core: Rate limit GID cache warning messages + +From: Maor Gottlieb + +[ 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 +Signed-off-by: Leon Romanovsky +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + 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 index 0000000000..edcda280e0 --- /dev/null +++ b/queue-5.4/regulator-core-fix-null-dereference-on-unbind-due-to.patch @@ -0,0 +1,44 @@ +From 2aa2f25c1e0c5a8de2db78c127a5be97f4f2b814 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Link: https://patch.msgid.link/20250626083809.314842-1-acarmina@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.4/series b/queue-5.4/series index 05a8f9e202..9b5cb59fd4 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -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