Commit 61ef8dd
mm/vmalloc: Warn on improper use of vunmap_range()
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.
Reviewed-by: Anshuman Khandual <[email protected]>
Reviewed-by: Catalin Marinas <[email protected]>
Reviewed-by: Uladzislau Rezki (Sony) <[email protected]>
Signed-off-by: Ryan Roberts <[email protected]>
Tested-by: Luiz Capitulino <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>1 parent f89b399 commit 61ef8dd
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
| 378 | + | |
378 | 379 | | |
| 380 | + | |
379 | 381 | | |
380 | 382 | | |
381 | 383 | | |
| |||
399 | 401 | | |
400 | 402 | | |
401 | 403 | | |
402 | | - | |
| 404 | + | |
| 405 | + | |
403 | 406 | | |
| 407 | + | |
404 | 408 | | |
405 | 409 | | |
406 | 410 | | |
| |||
0 commit comments