linux/drivers/iommu
Xiyu Yang 1adf30f198 iommu/arm-smmu: Fix arm_smmu_device refcount leak when arm_smmu_rpm_get fails
arm_smmu_rpm_get() invokes pm_runtime_get_sync(), which increases the
refcount of the "smmu" even though the return value is less than 0.

The reference counting issue happens in some error handling paths of
arm_smmu_rpm_get() in its caller functions. When arm_smmu_rpm_get()
fails, the caller functions forget to decrease the refcount of "smmu"
increased by arm_smmu_rpm_get(), causing a refcount leak.

Fix this issue by calling pm_runtime_resume_and_get() instead of
pm_runtime_get_sync() in arm_smmu_rpm_get(), which can keep the refcount
balanced in case of failure.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Link: https://lore.kernel.org/r/1623293672-17954-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Will Deacon <will@kernel.org>
2021-06-11 11:39:01 +01:00
..
amd iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
arm iommu/arm-smmu: Fix arm_smmu_device refcount leak when arm_smmu_rpm_get fails 2021-06-11 11:39:01 +01:00
intel pci-v5.13-changes 2021-05-05 13:24:11 -07:00
dma-iommu.c Merge branch 'stable/for-linus-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-05-04 10:58:49 -07:00
exynos-iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
fsl_pamu_domain.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
fsl_pamu_domain.h iommu/fsl_pamu: remove the snoop_id field 2021-04-07 10:56:52 +02:00
fsl_pamu.c iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace 2021-04-07 10:56:52 +02:00
fsl_pamu.h iommu/fsl_pamu: hardcode the window address and size in pamu_config_ppaace 2021-04-07 10:56:52 +02:00
hyperv-iommu.c iommu/hyperv: setup an IO-APIC IRQ remapping domain for root partition 2021-02-11 08:47:07 +00:00
io-pgfault.c iommu: Add a page fault handler 2021-04-07 10:54:29 +02:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Quad lvl1 pgtable for MediaTek 2021-02-01 11:31:17 +00:00
io-pgtable-arm.c IOMMU updates for 5.11 2020-12-16 13:58:47 -08:00
io-pgtable-arm.h iommu/io-pgtable-arm: Move some definitions to a header 2020-09-28 23:48:06 +01:00
io-pgtable.c iommu/amd: Prepare for generic IO page table framework 2021-01-28 16:51:17 +01:00
ioasid.c iommu/ioasid: Add ioasid references 2020-11-23 14:16:55 +00:00
iommu-debugfs.c
iommu-sva-lib.c iommu/sva: Add PASID helpers 2020-11-23 14:16:55 +00:00
iommu-sva-lib.h iommu: Add a page fault handler 2021-04-07 10:54:29 +02:00
iommu-sysfs.c drivers/iommu: Export core IOMMU API symbols to permit modular drivers 2019-12-23 14:06:05 +01:00
iommu-traces.c
iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
iova.c iommu: Stop exporting free_iova_fast() 2021-04-07 10:30:48 +02:00
ipmmu-vmsa.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
irq_remapping.c x86: Kill all traces of irq_remapping_get_irq_domain() 2020-10-28 20:26:28 +01:00
irq_remapping.h x86: Kill all traces of irq_remapping_get_irq_domain() 2020-10-28 20:26:28 +01:00
Kconfig Merge branches 'iommu/fixes', 'arm/mediatek', 'arm/smmu', 'arm/exynos', 'unisoc', 'x86/vt-d', 'x86/amd' and 'core' into next 2021-04-16 17:16:03 +02:00
Makefile Merge branches 'iommu/fixes', 'arm/mediatek', 'arm/smmu', 'arm/exynos', 'unisoc', 'x86/vt-d', 'x86/amd' and 'core' into next 2021-04-16 17:16:03 +02:00
msm_iommu_hw-8xxx.h
msm_iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
msm_iommu.h
mtk_iommu_v1.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
mtk_iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
mtk_iommu.h iommu/mediatek: Add mt8192 support 2021-02-01 11:31:19 +00:00
of_iommu.c iommu/arm-smmu-v3: Use device properties for pasid-num-bits 2021-04-07 10:54:28 +02:00
omap-iommu-debug.c iommu/omap: Check for failure of a call to omap_iommu_dump_ctx 2020-07-22 15:02:33 +02:00
omap-iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
omap-iommu.h iommu/omap: add support for late attachment of iommu devices 2019-08-09 17:37:10 +02:00
omap-iopgtable.h iommu/omap: Fix -Woverflow warnings when compiling on 64-bit architectures 2020-03-04 16:24:46 +01:00
rockchip-iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
s390-iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
sprd-iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
sun50i-iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
tegra-gart.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
tegra-smmu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00
virtio-iommu.c iommu: Streamline registration interface 2021-04-16 17:20:45 +02:00