• Fenghua Yu's avatar
    Intel-IOMMU Alignment Issue in dma_pte_clear_range() · 31d3568d
    Fenghua Yu authored
    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 because start and 
    end have been aligned to page boundary already by all callers. So the 
    issue has been hidden. But it is dangerous programming practice.
    Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
    Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
    31d3568d
intel-iommu.c 77.4 KB