[PATCH] arm: dma-mapping: fix potential endless loop in __dma_page_dev_to_cpu()

Marek Szyprowski m.szyprowski at samsung.com
Wed Aug 9 10:05:04 PDT 2023


Hi,

On 07.08.2023 18:23, Matthew Wilcox wrote:
> On Mon, Aug 07, 2023 at 05:26:57PM +0200, Marek Szyprowski wrote:
>> It is possible that the folio_size() of the next folio returns zero, so
> What?  How can folio_size() return zero?
>
>          return PAGE_SIZE << folio_order(folio);
>
> It is a minimum of PAGE_SIZE.

Well, the folio_order() on that next folio returns 255, so folio_size() 
overflows to zero. However, the main source of this issue is relying on 
the properties of the folio beyond the requested sync region.

 > ...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland




More information about the linux-arm-kernel mailing list