Skip to content

Commit b52f769

Browse files
carlocaionenashif
authored andcommitted
aarch64: mmu: Fix MMU permissions for zephyr code and data
User threads still need to access the code and the RO data. Fix the permissions. Signed-off-by: Carlo Caione <[email protected]>
1 parent a74f378 commit b52f769

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm/core/aarch64/mmu/arm_mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,13 @@ static const struct arm_mmu_flat_range mmu_zephyr_ranges[] = {
632632
{ .name = "zephyr_code",
633633
.start = _image_text_start,
634634
.end = _image_text_end,
635-
.attrs = MT_NORMAL | MT_P_RX_U_NA | MT_DEFAULT_SECURE_STATE },
635+
.attrs = MT_NORMAL | MT_P_RX_U_RX | MT_DEFAULT_SECURE_STATE },
636636

637637
/* Mark rodata segment cacheable, read only and execute-never */
638638
{ .name = "zephyr_rodata",
639639
.start = _image_rodata_start,
640640
.end = _image_rodata_end,
641-
.attrs = MT_NORMAL | MT_P_RO_U_NA | MT_DEFAULT_SECURE_STATE },
641+
.attrs = MT_NORMAL | MT_P_RO_U_RO | MT_DEFAULT_SECURE_STATE },
642642
};
643643

644644
static inline void add_arm_mmu_flat_range(struct arm_mmu_ptables *ptables,

0 commit comments

Comments
 (0)