alistair23-linux/drivers/iommu
Robin Murphy 757c370f03 iommu/iova: Sort out rbtree limit_pfn handling
When walking the rbtree, the fact that iovad->start_pfn and limit_pfn
are both inclusive limits creates an ambiguity once limit_pfn reaches
the bottom of the address space and they overlap. Commit 5016bdb796
("iommu/iova: Fix underflow bug in __alloc_and_insert_iova_range") fixed
the worst side-effect of this, that of underflow wraparound leading to
bogus allocations, but the remaining fallout is that any attempt to
allocate start_pfn itself erroneously fails.

The cleanest way to resolve the ambiguity is to simply make limit_pfn an
exclusive limit when inside the guts of the rbtree. Since we're working
with PFNs, representing one past the top of the address space is always
possible without fear of overflow, and elsewhere it just makes life a
little more straightforward.

Reported-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2017-05-17 15:34:15 +02:00
..
amd_iommu.c x86/events, drivers/iommu/amd: Introduce amd_iommu_get_num_iommus() 2017-03-30 09:53:53 +02:00
amd_iommu_init.c x86/events, drivers/amd/iommu: Prepare for multiple IOMMUs support 2017-03-30 09:53:55 +02:00
amd_iommu_proto.h x86/events, drivers/amd/iommu: Prepare for multiple IOMMUs support 2017-03-30 09:53:55 +02:00
amd_iommu_types.h x86/events, drivers/iommu/amd: Introduce amd_iommu_get_num_iommus() 2017-03-30 09:53:53 +02:00
amd_iommu_v2.c iommu/amd: Fix incorrect error handling in amd_iommu_bind_pasid() 2017-04-24 12:33:34 +02:00
arm-smmu-v3.c Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next 2017-05-04 18:06:17 +02:00
arm-smmu.c Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next 2017-05-04 18:06:17 +02:00
dma-iommu.c iommu/iova: Sort out rbtree limit_pfn handling 2017-05-17 15:34:15 +02:00
dmar.c iommu/dmar: Remove redundant ' != 0' when check return code 2017-03-22 15:42:17 +01:00
exynos-iommu.c Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next 2017-05-04 18:06:17 +02:00
fsl_pamu.c powerpc/fsl: Move fsl_guts.h out of arch/powerpc 2015-10-21 18:05:50 -05:00
fsl_pamu.h iommu: Remove pci.h include from trace/events/iommu.h 2017-04-29 00:20:49 +02:00
fsl_pamu_domain.c iommu/fsl: Convert to device_group call-back 2015-10-22 00:00:49 +02:00
fsl_pamu_domain.h
intel-iommu.c Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next 2017-05-04 18:06:17 +02:00
intel-svm.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/mm.h> 2017-03-02 08:42:28 +01:00
intel_irq_remapping.c iommu/vt-d: Don't print the failure message when booting non-kdump kernel 2017-04-28 23:38:42 +02:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it 2017-03-10 18:23:34 +00:00
io-pgtable-arm.c iommu/io-pgtable-arm: Avoid shift overflow in block size 2017-04-06 16:06:44 +01:00
io-pgtable.c iommu/io-pgtable: Fix a brace coding style issue. 2016-04-05 15:34:29 +02:00
io-pgtable.h iommu/io-pgtable: Add MTK 4GB mode in Short-descriptor 2016-04-05 15:39:37 +02:00
iommu-sysfs.c iommu: Make iommu_device_link/unlink take a struct iommu_device 2017-02-10 13:44:57 +01:00
iommu-traces.c
iommu.c Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next 2017-05-04 18:06:17 +02:00
iova.c iommu/iova: Sort out rbtree limit_pfn handling 2017-05-17 15:34:15 +02:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to 32-bit address space 2017-02-06 13:09:43 +01:00
irq_remapping.c x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage 2016-04-13 11:37:41 +02:00
irq_remapping.h
Kconfig vfio: ccw: basic implementation for vfio_ccw driver 2017-03-31 12:55:04 +02:00
Makefile Merge branches 'x86/amd', 'x86/vt-d', 'arm/exynos', 'arm/mediatek', 'arm/msm', 'arm/rockchip', 'arm/smmu' and 'core' into next 2016-07-26 16:02:37 +02:00
msm_iommu.c iommu: Remove iommu_register_instance interface 2017-02-10 14:54:37 +01:00
msm_iommu.h iommu/msm: Make use of iommu_device_register interface 2017-02-10 13:44:57 +01:00
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu: Remove iommu_register_instance interface 2017-02-10 14:54:37 +01:00
mtk_iommu.h iommu/mediatek: Make use of iommu_device_register interface 2017-02-10 13:44:57 +01:00
mtk_iommu_v1.c iommu/mediatek: Teach MTK-IOMMUv1 about 'struct iommu_device' 2017-04-03 13:17:02 +02:00
of_iommu.c iommu: of: Handle IOMMU lookup failure with deferred probing or error 2017-04-20 16:31:07 +02:00
omap-iommu-debug.c iommu/omap: Align code with open parenthesis 2016-04-05 17:53:20 +02:00
omap-iommu.c iommu/omap: Add iommu-group support 2017-04-20 16:33:59 +02:00
omap-iommu.h iommu/omap: Add iommu-group support 2017-04-20 16:33:59 +02:00
omap-iopgtable.h
rockchip-iommu.c Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next 2017-05-04 18:06:17 +02:00
s390-iommu.c iommu/s390: Drop duplicate header pci.h 2016-11-29 17:37:58 +01:00
tegra-gart.c
tegra-smmu.c iommu: Remove pci.h include from trace/events/iommu.h 2017-04-29 00:20:49 +02:00