Skip to content

Commit 3df1ffe

Browse files
softwareckikartben
authored andcommitted
xtensa: mmu: Fix partition permission definitions
Fix K_MEM_PARTITION_P_RX_U_RX definition to allow code execution from userspace. Add K_MEM_PARTITION_P_RX_U_NA definition that allows code execution only by kernel. Signed-off-by: Adrian Warecki <[email protected]>
1 parent fceb30d commit 3df1ffe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/zephyr/arch/xtensa/xtensa_mmu.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ typedef uint32_t k_mem_partition_attr_t;
6363
((k_mem_partition_attr_t) {0})
6464

6565
/* Execution-allowed attributes */
66-
#define K_MEM_PARTITION_P_RX_U_RX \
66+
#define K_MEM_PARTITION_P_RX_U_NA \
6767
((k_mem_partition_attr_t) {XTENSA_MMU_PERM_X})
68+
#define K_MEM_PARTITION_P_RX_U_RX \
69+
((k_mem_partition_attr_t) {XTENSA_MMU_PERM_X | XTENSA_MMU_MAP_USER})
6870

6971
/**
7072
* @}

0 commit comments

Comments
 (0)