Re: [PATCH] mm/vmalloc: fix mischeck pfn valid in vmap_pfns

From: Christoph Hellwig
Date: Thu Mar 20 2025 - 01:32:01 EST


On Wed, Mar 19, 2025 at 05:09:06PM +0800, Gao Xiang wrote:
> The minimum map unit is page size instead of variable-size folio.
>
> For many cases, vmap (to combine many partial folios) is useful
> (instead of split all folios to order-0 folios in advance) but
> I agree page array may be inefficient.
>
> So I don't think another folio vmap() version is better overall
> anyway.

Then just reject the mappings for now. vmap/vm_map_ram isn't really
intended for mapping totally arbitrary scattered memory anyway.
As mentioned before udmabuf also has a grave bug in the dma mapping
part, so just marking it broken would be another very sensible
option.