Skip to content

Commit 0114279

Browse files
ardbiesheuvelctmarinas
authored andcommitted
arm64: mm: avoid writable executable mappings in kexec/hibernate code
The temporary mappings of the low-level kexec and hibernate helpers are created with both writable and executable attributes, which is not necessary here, and generally best avoided. So use read-only, executable attributes instead. Signed-off-by: Ard Biesheuvel <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 6ee3cf6 commit 0114279

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/mm/trans_pgd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ int trans_pgd_idmap_page(struct trans_pgd_info *info, phys_addr_t *trans_ttbr0,
238238
int this_level, index, level_lsb, level_msb;
239239

240240
dst_addr &= PAGE_MASK;
241-
prev_level_entry = pte_val(pfn_pte(pfn, PAGE_KERNEL_EXEC));
241+
prev_level_entry = pte_val(pfn_pte(pfn, PAGE_KERNEL_ROX));
242242

243243
for (this_level = 3; this_level >= 0; this_level--) {
244244
levels[this_level] = trans_alloc(info);

0 commit comments

Comments
 (0)