diff options
author | Robin Murphy | 2022-11-04 19:51:43 +0000 |
---|---|---|
committer | Greg Kroah-Hartman | 2022-12-31 13:32:49 +0100 |
commit | 26427454bebf3e59c2c9020d9f3a8478669d062b (patch) | |
tree | 822aa9cc378da4ee9b2f9b0335182c229d54df61 /drivers/message | |
parent | feca904412483b2e0a903dd1f2e2843afd445f8c (diff) |
iommu: Avoid races around device probe
[ Upstream commit 01657bc14a3990c665375f77978631fee77b1fce ]
We currently have 3 different ways that __iommu_probe_device() may be
called, but no real guarantee that multiple callers can't tread on each
other, especially once asynchronous driver probe gets involved. It would
likely have taken a fair bit of luck to hit this previously, but commit
57365a04c921 ("iommu: Move bus setup to IOMMU device registration") ups
the odds since now it's not just omap-iommu that may trigger multiple
bus_iommu_probe() calls in parallel if probing asynchronously.
Add a lock to ensure we can't try to double-probe a device, and also
close some possible race windows to make sure we're truly robust against
trying to double-initialise a group via two different member devices.
Reported-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Brian Norris <briannorris@chromium.org>
Fixes: 57365a04c921 ("iommu: Move bus setup to IOMMU device registration")
Link: https://lore.kernel.org/r/1946ef9f774851732eed78760a78ec40dbc6d178.1667591503.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/message')
0 files changed, 0 insertions, 0 deletions