FROMLIST: iommu: Avoid more races around device probe
It turns out there are more subtle races beyond just the main part of __iommu_probe_device() itself running in parallel - the dev_iommu_free() on the way out of an unsuccessful probe can still manage to trip up concurrent accesses to a device's fwspec. Thus, extend the scope of iommu_probe_device_lock() to also serialise fwspec creation and initial retrieval. Reported-by:Zhenhua Huang <quic_zhenhuah@quicinc.com> Link: https://lore.kernel.org/linux-iommu/e2e20e1c-6450-4ac5-9804-b0000acdf7de@quicinc.com/ Fixes: 01657bc1 ("iommu: Avoid races around device probe") Signed-off-by:
Robin Murphy <robin.murphy@arm.com> Bug: 308940593 Bug: 313035219 Bug: 315916825 Link: https://lore.kernel.org/all/16f433658661d7cadfea51e7c65da95826112a2b.1700071477.git.robin.murphy@arm.com/ Change-Id: I461df05b03644cb93bc93599cb9f5464bf893923 Signed-off-by:
André Draszik <draszik@google.com> (cherry picked from commit 95307ec5) (cherry picked from commit 64534c16)
Loading