Skip to content

Commit bcef633

Browse files
Nicolas Pitrecarlescufi
authored andcommitted
arch/arm64/mmu: arch_mem_map() should not overwrite existing mappings
If so this is most certainly a bug. arch_mem_unmap() should be used before mapping the same area again. Signed-off-by: Nicolas Pitre <[email protected]>
1 parent 364d752 commit bcef633

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/core/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ static void sync_domains(uintptr_t virt, size_t size)
892892
static int __arch_mem_map(void *virt, uintptr_t phys, size_t size, uint32_t flags)
893893
{
894894
struct arm_mmu_ptables *ptables;
895-
uint32_t entry_flags = MT_DEFAULT_SECURE_STATE | MT_P_RX_U_NA;
895+
uint32_t entry_flags = MT_DEFAULT_SECURE_STATE | MT_P_RX_U_NA | MT_NO_OVERWRITE;
896896

897897
/* Always map in the kernel page tables */
898898
ptables = &kernel_ptables;

0 commit comments

Comments
 (0)