From: Mika Westerberg <mika.westerberg(a)linux.intel.com>
stable inclusion
from stable-v5.10.225
commit 747bc154577de6e6af4bc99abfa859b8419bb4d8
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAR5FZ
CVE: CVE-2024-46702
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
---------------------------------------------------------------
commit e2006140ad2e01a02ed0aff49cc2ae3ceeb11f8d upstream.
I noticed that when we do discrete host router NVM upgrade and it gets
hot-removed from the PCIe side as a result of NVM firmware authentication,
if there is another host connected with enabled paths we hang in tearing
them down. This is due to fact that the Thunderbolt networking driver
also tries to cleanup the paths and ends up blocking in
tb_disconnect_xdomain_paths() waiting for the domain lock.
However, at this point we already cleaned the paths in tb_stop() so
there is really no need for tb_disconnect_xdomain_paths() to do that
anymore. Furthermore it already checks if the XDomain is unplugged and
bails out early so take advantage of that and mark the XDomain as
unplugged when we remove the parent router.
Cc: stable(a)vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg(a)linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Zhang Zekun <zhangzekun11(a)huawei.com>
---
drivers/thunderbolt/switch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index b13a944eb462..f6580d11c0fe 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -2584,6 +2584,7 @@ void tb_switch_remove(struct tb_switch *sw)
tb_switch_remove(port->remote->sw);
port->remote = NULL;
} else if (port->xdomain) {
+ port->xdomain->is_unplugged = true;
tb_xdomain_remove(port->xdomain);
port->xdomain = NULL;
}
--
2.17.1
From: Mika Westerberg <mika.westerberg(a)linux.intel.com>
stable inclusion
from stable-v5.10.225
commit 747bc154577de6e6af4bc99abfa859b8419bb4d8
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAR5FZ
CVE: CVE-2024-46702
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
---------------------------------------------------------------
commit e2006140ad2e01a02ed0aff49cc2ae3ceeb11f8d upstream.
I noticed that when we do discrete host router NVM upgrade and it gets
hot-removed from the PCIe side as a result of NVM firmware authentication,
if there is another host connected with enabled paths we hang in tearing
them down. This is due to fact that the Thunderbolt networking driver
also tries to cleanup the paths and ends up blocking in
tb_disconnect_xdomain_paths() waiting for the domain lock.
However, at this point we already cleaned the paths in tb_stop() so
there is really no need for tb_disconnect_xdomain_paths() to do that
anymore. Furthermore it already checks if the XDomain is unplugged and
bails out early so take advantage of that and mark the XDomain as
unplugged when we remove the parent router.
Cc: stable(a)vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg(a)linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Zhang Zekun <zhangzekun11(a)huawei.com>
---
drivers/thunderbolt/switch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index b13a944eb462..f6580d11c0fe 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -2584,6 +2584,7 @@ void tb_switch_remove(struct tb_switch *sw)
tb_switch_remove(port->remote->sw);
port->remote = NULL;
} else if (port->xdomain) {
+ port->xdomain->is_unplugged = true;
tb_xdomain_remove(port->xdomain);
port->xdomain = NULL;
}
--
2.17.1