diff options
author | Robin Murphy <robin.murphy@arm.com> | 2022-11-04 19:51:43 +0000 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2022-11-19 10:17:42 +0100 |
commit | 01657bc14a3990c665375f77978631fee77b1fce (patch) | |
tree | 3328773667b49e9c7b8ef9c84c474982c95ec50c /lib/mpi/mpiutil.c | |
parent | 69e61edebea030f177de7a23b8d5d9b8c4a90bda (diff) |
iommu: Avoid races around device probe
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>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions