All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] Revert "tpci: unbind driver in test_assign_resources()"
@ 2026-07-14  9:06 Hongtao Zhang via ltp
  2026-07-14 10:49 ` [LTP] " linuxtestproject.agent
  0 siblings, 1 reply; 3+ messages in thread
From: Hongtao Zhang via ltp @ 2026-07-14  9:06 UTC (permalink / raw)
  To: ltp, andrea.cervesato; +Cc: liuyongqiang13

While the patch fixes a use-after-free in /proc/iomem by unbinding and
rebinding the driver around PCI resource reassignment, this approach is
too dangerous for a general test. Unbinding a driver from a critical device
(e.g. a network or block controller) can instantly break SSH connectivity or
cause filesystem corruption. Such side effects are unacceptable compared to the original issue.
So need to revert that patch.

Signed-off-by: Hongtao Zhang <zhanghongtao35@huawei.com>
---
 .../device-drivers/pci/tpci_kernel/ltp_tpci.c     | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c b/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
index 45138d834..660b3a423 100644
--- a/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
+++ b/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
@@ -442,24 +442,9 @@ static int test_assign_resources(void)
 
 		if (r->flags & IORESOURCE_MEM &&
 			r->flags & IORESOURCE_PREFETCH) {
-
-			if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
-				if (dev->dev.driver)
-					device_release_driver(&dev->dev);
-			}
-
 			pci_release_resource(dev, i);
 			ret = pci_assign_resource(dev, i);
 			prk_info("assign resource to '%d', ret '%d'", i, ret);
-
-			if (ret == 0 && dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
-				int attach_ret;
-
-				attach_ret = device_attach(&dev->dev);
-				if (attach_ret < 0)
-					prk_info("device_attach failed for endpoint, ret: %d", attach_ret);
-			}
-
 			rc |= (ret < 0 && ret != -EBUSY) ? TFAIL : TPASS;
 		}
 	}
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-07-14 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14  9:06 [LTP] [PATCH] Revert "tpci: unbind driver in test_assign_resources()" Hongtao Zhang via ltp
2026-07-14 10:49 ` [LTP] " linuxtestproject.agent
2026-07-14 11:05   ` Yizhou Tang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.