Skip to content

Commit

Permalink
[PATCH] x86-64: Fix off by one error in IOMMU boundary checking
Browse files Browse the repository at this point in the history
Should be harmless because there is normally no memory there, but
technically it was incorrect.

Pointed out by Leo Duran

Signed-off-by: Andi Kleen <ak@suse.de>
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Feb 13, 2007
1 parent ffb6017 commit 00edefa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86_64/kernel/pci-gart.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static void iommu_full(struct device *dev, size_t size, int dir)
static inline int need_iommu(struct device *dev, unsigned long addr, size_t size)
{
u64 mask = *dev->dma_mask;
int high = addr + size >= mask;
int high = addr + size > mask;
int mmu = high;
if (force_iommu)
mmu = 1;
Expand All @@ -195,7 +195,7 @@ static inline int need_iommu(struct device *dev, unsigned long addr, size_t size
static inline int nonforced_iommu(struct device *dev, unsigned long addr, size_t size)
{
u64 mask = *dev->dma_mask;
int high = addr + size >= mask;
int high = addr + size > mask;
int mmu = high;
return mmu;
}
Expand Down

0 comments on commit 00edefa

Please sign in to comment.