Thread (32 messages) 32 messages, 5 authors, 2025-02-25

Re: [PATCH v2 08/14] mm/vmalloc: Warn on improper use of vunmap_range()

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2025-02-24 12:03:17
Also in: linux-mm, lkml

On Mon, Feb 17, 2025 at 02:08:00PM +0000, Ryan Roberts wrote:
A call to vmalloc_huge() may cause memory blocks to be mapped at pmd or
pud level. But it is possible to subsequently call vunmap_range() on a
sub-range of the mapped memory, which partially overlaps a pmd or pud.
In this case, vmalloc unmaps the entire pmd or pud so that the
no-overlapping portion is also unmapped. Clearly that would have a bad
outcome, but it's not something that any callers do today as far as I
can tell. So I guess it's just expected that callers will not do this.

However, it would be useful to know if this happened in future; let's
add a warning to cover the eventuality.

Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help