linux-stable/drivers/iommu
Robin Murphy 68bc7b2003 iommu: Avoid more races around device probe
commit a2e7e59a94 upstream.

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: 01657bc14a ("iommu: Avoid races around device probe")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Tested-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/16f433658661d7cadfea51e7c65da95826112a2b.1700071477.git.robin.murphy@arm.com
Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-13 18:39:17 +01:00
..
amd iommu/amd/iommu_v2: Fix pasid_state refcount dec hit 0 warning on pasid unbind 2023-09-13 09:42:50 +02:00
arm iommu/arm-smmu-v3: Avoid constructing invalid range commands 2023-10-10 22:00:37 +02:00
intel iommu/vt-d: Make context clearing consistent with context mapping 2023-12-08 08:51:19 +01:00
apple-dart.c
dma-iommu.c
dma-iommu.h
exynos-iommu.c
fsl_pamu.c
fsl_pamu.h
fsl_pamu_domain.c
fsl_pamu_domain.h
hyperv-iommu.c
io-pgfault.c mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
io-pgtable-arm-v7s.c
io-pgtable-arm.c
io-pgtable-arm.h
io-pgtable-dart.c
io-pgtable.c
ioasid.c
iommu-debugfs.c
iommu-sva-lib.c
iommu-sva-lib.h
iommu-sysfs.c
iommu-traces.c
iommu.c iommu: Avoid more races around device probe 2023-12-13 18:39:17 +01:00
iova.c
ipmmu-vmsa.c
irq_remapping.c
irq_remapping.h
Kconfig
Makefile
msm_iommu.c
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mediatek: Fix share pgtable for iova over 4GB 2023-10-10 22:00:41 +02:00
mtk_iommu_v1.c
of_iommu.c iommu: Avoid more races around device probe 2023-12-13 18:39:17 +01:00
omap-iommu-debug.c
omap-iommu.c
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu: rockchip: Fix directory table address encoding 2023-09-13 09:42:50 +02:00
s390-iommu.c
sprd-iommu.c iommu/sprd: Add missing force_aperture 2023-09-13 09:42:53 +02:00
sun50i-iommu.c
tegra-gart.c
tegra-smmu.c
virtio-iommu.c iommu/virtio: Return size mapped for a detached domain 2023-07-19 16:21:20 +02:00