[PATCH v8 02/15] virt: coco: tsm: Remove the device from lookup before PCI teardown
Tian, Kevin
kevin.tian at intel.com
Thu Nov 5 23:04:25 PST 2026
> From: Aneesh Kumar K.V (Arm) <aneesh.kumar at kernel.org>
> Sent: Thursday, November 5, 2026 12:16 AM
>
> PCI connect looks up a TSM by ID under pci_tsm_rwsem. Previously,
> tsm_unregister() released that lock after tearing down PCI state while
> the TSM was still in the class lookup. A racing connect could then
> attach a new PCI context that the teardown would never see.
>
> Remove the device from the class lookup first, then take the PCI write
> lock to drain in-flight operations and destroy their contexts. Drop the
> device reference only after PCI teardown completes.
>
> Fixes: 3225f52cde56 ("PCI/TSM: Establish Secure Sessions and Link Encryption")
> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar at kernel.org>
Reviewed-by: Kevin Tian <kevin.tian at intel.com>
btw this can be sent separately.
More information about the linux-arm-kernel
mailing list