Re: [PATCH] Intel-IOMMU Alignment Issue in dma_pte_clear_range()

From: David Woodhouse
Date: Mon Apr 06 2009 - 17:49:00 EST


On Mon, 2009-04-06 at 11:21 -0700, Fenghua Yu wrote:
> This issue was pointed out by Linus.
>
> In dma_pte_clear_range() in intel-iommu.c
>
> start = PAGE_ALIGN(start);
> end &= PAGE_MASK;
> npages = (end - start) / VTD_PAGE_SIZE;
>
> In partial page case, start could be bigger than end and npages will be
> negative.
>
> Currently the issue doesn't show up as a real bug in testing because start and
> end have been aligned to page boundary already by all callers. So the issue has
> been hiden. But it is dangerous programming practice.
>
> The following patch fixes the issue. It's applied on iommu-2.6.git tree.
>
> Signed-off-by: Fenghua Yu <fenghua.yu@xxxxxxxxx>

Applied to git://git.infradead.org/iommu-2.6.git; thanks.

--
David Woodhouse Open Source Technology Centre
David.Woodhouse@xxxxxxxxx Intel Corporation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/