]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
thunderbolt: Keep the domain reference while processing hotplug
authorMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 21 Nov 2025 06:47:23 +0000 (08:47 +0200)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 5 May 2026 11:53:46 +0000 (13:53 +0200)
commit138ec65b2c761f065b19d115aed2b8246fc272f5
tree1e451c7e424a5efcbee4f20178dd35def42da09f
parent2fb199dc64056ada4aa820a68931fed60333c289
thunderbolt: Keep the domain reference while processing hotplug

We process hotplug events in a workqueue that may run after the domain
has been removed by tb_domain_remove(). For example if user unloads the
driver while at the same time plugging  a device router we may have
scheduled tb_handle_hotplug() to run. Avoid possible UAF in this case by
taking the domain reference before scheduling the hotplug handler in
tb_queue_hotplug().

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/tb.c