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 <ardb@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/r/20220429131347.3621090-3-ardb@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 6ee3cf6 commit 0114279

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)