Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH 5.10] RDMA/hfi1: shut down the trap timer before unregistering
@ 2026-12-01 15:00 Alexander Martyniuk
  2026-12-01 15:11 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Martyniuk @ 2026-12-01 15:00 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman
  Cc: Alexander Martyniuk, lvc-project, Mike Marciniszyn,
	Dennis Dalessandro, Doug Ledford, Jason Gunthorpe,
	Michael N. Henry, Michael J. Ruhl, linux-rdma, linux-kernel,
	Hongyan Xu, Leon Romanovsky

From: Hongyan Xu <getshell@seu.edu.cn>

commit a1c9d476c2316685f85fffb6450ad88d01836357 upstream.

MAD processing arms a trap timer embedded in each hfi1_ibport. Device
unregistration does not stop the timer, so its callback can run after
the port and its containing hfi1_devdata have been released.

Shut down every port timer before unregistering the IB device. The
shutdown form also prevents a concurrent path from rearming the timer.

Fixes: bf90aadd630c ("IB/hfi1: Send MAD traps until repressed")
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
Link: https://patch.msgid.link/20260928134151.1213-1-getshell@seu.edu.cn
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[Alexander: del_timer_sync() used instead of the timer_shutdown_sync()]
Signed-off-by: Alexander Martyniuk <alexevgmart@gmail.com>
---
Backport fix for CVE-2026-139571
 drivers/infiniband/hw/hfi1/verbs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index 693922df3543..06cb57da73b2 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -1950,6 +1950,10 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
 void hfi1_unregister_ib_device(struct hfi1_devdata *dd)
 {
 	struct hfi1_ibdev *dev = &dd->verbs_dev;
+	int i;
+
+	for (i = 0; i < dd->num_pports; i++)
+		del_timer_sync(&dd->pport[i].ibport_data.rvp.trap_timer);
 
 	hfi1_verbs_unregister_sysfs(dd);
 
-- 
2.43.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-01 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 15:00 [PATCH 5.10] RDMA/hfi1: shut down the trap timer before unregistering Alexander Martyniuk
2026-12-01 15:11 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox