From 37bdc05f16f283a25547584e456d3b0e19be2832 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 24 Jul 2025 10:15:07 -0400 Subject: [PATCH] Fixes for 5.10 Signed-off-by: Sasha Levin --- ...ate-limit-gid-cache-warning-messages.patch | 44 +++++++++++++++++++ ...ix-null-dereference-on-unbind-due-to.patch | 44 +++++++++++++++++++ queue-5.10/series | 2 + 3 files changed, 90 insertions(+) create mode 100644 queue-5.10/rdma-core-rate-limit-gid-cache-warning-messages.patch create mode 100644 queue-5.10/regulator-core-fix-null-dereference-on-unbind-due-to.patch 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 index 0000000000..db002fc1bf --- /dev/null +++ b/queue-5.10/rdma-core-rate-limit-gid-cache-warning-messages.patch @@ -0,0 +1,44 @@ +From c1dafe8c5321204ed813b3b7477af220c76840b2 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 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 index 0000000000..17b57944c0 --- /dev/null +++ b/queue-5.10/regulator-core-fix-null-dereference-on-unbind-due-to.patch @@ -0,0 +1,44 @@ +From 33c261ae5ecdaf81da470c4761464c6fbf7488e2 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 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 + diff --git a/queue-5.10/series b/queue-5.10/series index f1a0b560b4..5082cf9498 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -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 -- 2.47.2