The patch titled Subject: dmapool: fix overflow condition in pool_find_page() has been added to the -mm tree. Its filename is dmapool-fix-overflow-condition-in-pool_find_page.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/dmapool-fix-overflow-condition-in-pool_find_page.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/dmapool-fix-overflow-condition-in-pool_find_page.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Robin Murphy <robin.murphy@xxxxxxx> Subject: dmapool: fix overflow condition in pool_find_page() If a DMA pool lies at the very top of the dma_addr_t range (as may happen with an IOMMU involved), the calculated end address of the pool wraps around to zero, and page lookup always fails. Tweak the relevant calculation to be overflow-proof. Signed-off-by: Robin Murphy <robin.murphy@xxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Cc: Sumit Semwal <sumit.semwal@xxxxxxxxxx> Cc: Sakari Ailus <sakari.ailus@xxxxxx> Cc: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/dmapool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/dmapool.c~dmapool-fix-overflow-condition-in-pool_find_page mm/dmapool.c --- a/mm/dmapool.c~dmapool-fix-overflow-condition-in-pool_find_page +++ a/mm/dmapool.c @@ -394,7 +394,7 @@ static struct dma_page *pool_find_page(s list_for_each_entry(page, &pool->page_list, page_list) { if (dma < page->dma) continue; - if (dma < (page->dma + pool->allocation)) + if ((dma - page->dma) < pool->allocation) return page; } return NULL; _ Patches currently in -mm which might be from robin.murphy@xxxxxxx are dmapool-fix-overflow-condition-in-pool_find_page.patch dma-mapping-tidy-up-dma_parms-default-handling.patch dma-debug-check-nents-in-dma_sync_sg.patch dma-debug-allow-poisoning-nonzero-allocations.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html