Skip to content

Commit b34d2ef

Browse files
Ard Biesheuvelwildea01
authored andcommitted
arm64: mm: purge lazily unmapped vm regions before changing permissions
Call vm_unmap_aliases() every time we apply any changes to permission attributes of mappings in the vmalloc region. This avoids any potential issues resulting from lingering writable or executable aliases of mappings that should be read-only or non-executable, respectively. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 9ff0119 commit b34d2ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/arm64/mm/pageattr.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ static int change_memory_common(unsigned long addr, int numpages,
9393
if (!numpages)
9494
return 0;
9595

96+
/*
97+
* Get rid of potentially aliasing lazily unmapped vm areas that may
98+
* have permissions set that deviate from the ones we are setting here.
99+
*/
100+
vm_unmap_aliases();
101+
96102
return __change_memory_common(start, size, set_mask, clear_mask);
97103
}
98104

0 commit comments

Comments
 (0)