* [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; 4+ 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] 4+ messages in thread
* Re: [LTP] Revert "tpci: unbind driver in test_assign_resources()"
2026-07-14 9:06 [LTP] [PATCH] Revert "tpci: unbind driver in test_assign_resources()" Hongtao Zhang via ltp
@ 2026-07-14 10:49 ` linuxtestproject.agent
2026-07-14 11:05 ` Yizhou Tang
0 siblings, 1 reply; 4+ messages in thread
From: linuxtestproject.agent @ 2026-07-14 10:49 UTC (permalink / raw)
To: Hongtao Zhang; +Cc: ltp
Hi Hongtao,
On Tue, 14 Jul 2026 17:06:32 +0800, Hongtao Zhang wrote:
> Revert "tpci: unbind driver in test_assign_resources()"
Two small commit-message issues below; the code itself looks fine.
> 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.
"So need to revert that patch." reads informally and is grammatically
incomplete. The motivation was already stated in the preceding sentences;
this closing line can be dropped entirely, or rewritten as "Revert the
patch."
Also, the body is missing the standard traceability line that git revert
adds: "This reverts commit <full-SHA>." Without it, bisect and git-log
searches cannot mechanically link this revert to the commit it undoes.
The subject quotes the original message, but the SHA makes the link
unambiguous. Please add it.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] Revert "tpci: unbind driver in test_assign_resources()"
2026-07-14 10:49 ` [LTP] " linuxtestproject.agent
@ 2026-07-14 11:05 ` Yizhou Tang
2026-07-15 15:54 ` Andrea Cervesato via ltp
0 siblings, 1 reply; 4+ messages in thread
From: Yizhou Tang @ 2026-07-14 11:05 UTC (permalink / raw)
To: linuxtestproject.agent; +Cc: ltp, Hongtao Zhang
On Tue, Jul 14, 2026 at 6:50 PM <linuxtestproject.agent@gmail.com> wrote:
>
> Hi Hongtao,
>
> On Tue, 14 Jul 2026 17:06:32 +0800, Hongtao Zhang wrote:
> > Revert "tpci: unbind driver in test_assign_resources()"
>
> Two small commit-message issues below; the code itself looks fine.
>
> > 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.
>
> "So need to revert that patch." reads informally and is grammatically
> incomplete. The motivation was already stated in the preceding sentences;
> this closing line can be dropped entirely, or rewritten as "Revert the
> patch."
>
> Also, the body is missing the standard traceability line that git revert
> adds: "This reverts commit <full-SHA>." Without it, bisect and git-log
> searches cannot mechanically link this revert to the commit it undoes.
> The subject quotes the original message, but the SHA makes the link
> unambiguous. Please add it.
>
> Verdict - Needs revision
Hi,
We recently confirmed this commit does cause a flood of I/O errors on
the root filesystem in our testing, leaving the machine unusable until
reboot.
Given that, we'd appreciate the community helping to decide soon
whether the revert is warranted.
Best regards,
Yi
>
>
> ---
> Note:
>
> The agent can sometimes produce false positives although often its
> findings are genuine. If you find issues with the review, please
> comment this email or ignore the suggestions.
>
> Regards,
> LTP AI Reviewer
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] Revert "tpci: unbind driver in test_assign_resources()"
2026-07-14 11:05 ` Yizhou Tang
@ 2026-07-15 15:54 ` Andrea Cervesato via ltp
0 siblings, 0 replies; 4+ messages in thread
From: Andrea Cervesato via ltp @ 2026-07-15 15:54 UTC (permalink / raw)
To: Yizhou Tang; +Cc: Hongtao Zhang, ltp, linuxtestproject.agent
Hi Yizhou,
> Hi,
>
> We recently confirmed this commit does cause a flood of I/O errors on
> the root filesystem in our testing, leaving the machine unusable until
> reboot.
>
> Given that, we'd appreciate the community helping to decide soon
> whether the revert is warranted.
Are you 100% sure that is caused by the patch you want to revert?
Because the patch looked ok to me when I reviewed. We need to have
more context and info around the issue which has been generated in
order to avoid any workaround for a system/kernel bug.
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-15 15:55 UTC | newest]
Thread overview: 4+ 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
2026-07-15 15:54 ` Andrea Cervesato via ltp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox