summaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm/pageattr.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-11-07 11:36:19 +0100
committerWill Deacon <will.deacon@arm.com>2018-11-20 12:38:26 +0100
commitb34d2ef0c60e4d9c2bb8a4d72d4519c67363d390 (patch)
treedbeb02f908943cc0c5fdcbecc87b187389b7d449 /arch/arm64/mm/pageattr.c
parentLinux 4.20-rc3 (diff)
downloadlinux-b34d2ef0c60e4d9c2bb8a4d72d4519c67363d390.tar.xz
linux-b34d2ef0c60e4d9c2bb8a4d72d4519c67363d390.zip
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 <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/mm/pageattr.c')
-rw-r--r--arch/arm64/mm/pageattr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
index a56359373d8b..787f9e385e6d 100644
--- a/arch/arm64/mm/pageattr.c
+++ b/arch/arm64/mm/pageattr.c
@@ -93,6 +93,12 @@ static int change_memory_common(unsigned long addr, int numpages,
if (!numpages)
return 0;
+ /*
+ * Get rid of potentially aliasing lazily unmapped vm areas that may
+ * have permissions set that deviate from the ones we are setting here.
+ */
+ vm_unmap_aliases();
+
return __change_memory_common(start, size, set_mask, clear_mask);
}