summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2008-07-21 10:15:22 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-23 16:45:15 +0200
commit05d3ed0a1fe3ea05ab9f3b8d32576a0bc2e19660 (patch)
tree22bd4eb8e45d9a3c07ac7de5de3b30121820c4db /arch
parentc010b2f76c3032e48097a6eef291d8593d5d79a6 (diff)
downloadop-kernel-dev-05d3ed0a1fe3ea05ab9f3b8d32576a0bc2e19660.zip
op-kernel-dev-05d3ed0a1fe3ea05ab9f3b8d32576a0bc2e19660.tar.gz
x86, pci: iommu fix potential overflow in alloc_iommu()
It is possible that alloc_iommu()'s boundary_size overflows as dma_get_seg_boundary can return 0xffffffff. In that case, further usage of boundary_size triggers a BUG_ON() in the iommu code. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/pci-gart_64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index df5f142..1062dc1 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -93,7 +93,7 @@ static unsigned long alloc_iommu(struct device *dev, int size)
base_index = ALIGN(iommu_bus_base & dma_get_seg_boundary(dev),
PAGE_SIZE) >> PAGE_SHIFT;
- boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
+ boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1,
PAGE_SIZE) >> PAGE_SHIFT;
spin_lock_irqsave(&iommu_bitmap_lock, flags);
OpenPOWER on IntegriCloud