linux/drivers/iommu
Jiang Liu 4ce9fbccfb iommu/vt-d: Fix an off-by-one bug in __domain_mapping()
commit cc4f14aa17 upstream.

There's an off-by-one bug in function __domain_mapping(), which may
trigger the BUG_ON(nr_pages < lvl_pages) when
	(nr_pages + 1) & superpage_mask == 0

The issue was introduced by commit 9051aa0268 "intel-iommu: Combine
domain_pfn_mapping() and domain_sg_mapping()", which sets sg_res to
"nr_pages + 1" to avoid some of the 'sg_res==0' code paths.

It's safe to remove extra "+1" because sg_res is only used to calculate
page size now.

Reported-And-Tested-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-By: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-16 06:59:31 -08:00
..
Kconfig iommu: shmobile: Enable driver compilation with COMPILE_TEST 2014-01-07 15:10:11 +01:00
Makefile iommu: Add event tracing feature to iommu 2013-09-24 12:35:24 +02:00
amd_iommu.c iommu/amd: Fix cleanup_domain for mass device removal 2014-09-17 09:19:07 -07:00
amd_iommu_init.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
amd_iommu_proto.h perf/x86/amd: Add IOMMU Performance Counter resource management 2013-06-19 13:04:52 +02:00
amd_iommu_types.h perf/x86/amd: Add IOMMU Performance Counter resource management 2013-06-19 13:04:52 +02:00
amd_iommu_v2.c IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
arm-smmu.c iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1 2014-10-05 14:52:15 -07:00
dmar.c iommu/vt-d, trivial: clean sparse warnings 2014-01-09 12:44:16 +01:00
exynos-iommu.c iommu/exynos: Remove dead code (set_prefbuf) 2013-08-14 11:28:45 +02:00
fsl_pamu.c iommu/fsl: Remove unnecessary 'fsl-pamu' prefixes 2013-08-14 11:44:30 +02:00
fsl_pamu.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
fsl_pamu_domain.c iommu/fsl_pamu: Use dev_is_pci() to check whether it is pci device 2014-01-07 15:23:08 +01:00
fsl_pamu_domain.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
intel-iommu.c iommu/vt-d: Fix an off-by-one bug in __domain_mapping() 2015-01-16 06:59:31 -08:00
intel_irq_remapping.c IOMMU Updates for Linux v3.14 2014-01-29 20:00:13 -08:00
iommu-traces.c iommu: Add iommu_error class event to iommu trace 2013-09-25 11:07:04 +02:00
iommu.c Merge branches 'iommu/fixes', 'tracing', 'core', 'arm/tegra', 'x86/vt-d', 'arm/smmu' and 'arm/shmobile' into next 2013-11-01 14:44:25 +01:00
iova.c iommu: Fix typo in iommu 2012-07-24 12:58:49 +02:00
irq_remapping.c iommu/vt-d, trivial: clean sparse warnings 2014-01-09 12:44:16 +01:00
irq_remapping.h iommu/vt-d: add quirk for broken interrupt remapping on 55XX chipsets 2013-04-18 17:00:47 +02:00
msm_iommu.c iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu_dev.c drivers/iommu: remove unnecessary platform_set_drvdata() 2013-09-11 15:56:24 -07:00
msm_iommu_hw-8xxx.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
of_iommu.c iommu: add missing include 2014-01-07 15:16:27 +01:00
omap-iommu-debug.c drivers/iommu/omap-iommu-debug.c: fix decimal permissions 2014-02-25 15:25:42 -08:00
omap-iommu.c drivers/iommu: remove unnecessary platform_set_drvdata() 2013-09-11 15:56:24 -07:00
omap-iommu.h iommu/omap: Adapt to runtime pm 2012-12-03 18:48:23 +01:00
omap-iommu2.c iommu/omap: Adapt to runtime pm 2012-12-03 18:48:23 +01:00
omap-iopgtable.h drivers/iommu/omap-iopgtable.h: remove unneeded cast of void* 2013-11-13 12:09:00 +09:00
omap-iovmm.c iommu/omap: fix checkpatch warnings in omap iommu code 2013-06-20 16:53:26 +02:00
pci.h iommu: Move swap_pci_ref function to drivers/iommu/pci.h. 2013-04-23 14:55:00 +02:00
shmobile-iommu.c iommu/shmobile: Allocate archdata with kzalloc() 2014-01-07 15:35:25 +01:00
shmobile-ipmmu.c iommu/shmobile: Turn the flush_lock mutex into a spinlock 2014-01-07 15:35:25 +01:00
shmobile-ipmmu.h iommu/shmobile: Turn the flush_lock mutex into a spinlock 2014-01-07 15:35:25 +01:00
tegra-gart.c iommu/tegra-gart: Staticize tegra_gart_pm_ops 2013-11-01 14:23:20 +01:00
tegra-smmu.c iommu/tegra-smmu: Staticize tegra_smmu_pm_ops 2013-11-01 14:23:33 +01:00