diff options
author | Alexandre Ghiti <alexghiti@rivosinc.com> | 2023-12-13 14:40:27 +0100 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2024-01-09 19:59:08 +0100 |
commit | b8b2711336f03ece539de61479d6ffc44fb603d3 (patch) | |
tree | af5280e79a37f852f755fed68942588664a60e50 /arch/riscv/mm/pageattr.c | |
parent | riscv: Fix module_alloc() that did not reset the linear mapping permissions (diff) | |
download | linux-b8b2711336f03ece539de61479d6ffc44fb603d3.tar.xz linux-b8b2711336f03ece539de61479d6ffc44fb603d3.zip |
riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC
When resetting the linear mapping permissions, we must make sure that we
clear the X bit so that do not end up with WX mappings (since we set
PAGE_KERNEL).
Fixes: 395a21ff859c ("riscv: add ARCH_HAS_SET_DIRECT_MAP support")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20231213134027.155327-3-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/mm/pageattr.c')
-rw-r--r-- | arch/riscv/mm/pageattr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/mm/pageattr.c b/arch/riscv/mm/pageattr.c index 96cbda683936..01398fee5cf8 100644 --- a/arch/riscv/mm/pageattr.c +++ b/arch/riscv/mm/pageattr.c @@ -383,7 +383,7 @@ int set_direct_map_invalid_noflush(struct page *page) int set_direct_map_default_noflush(struct page *page) { return __set_memory((unsigned long)page_address(page), 1, - PAGE_KERNEL, __pgprot(0)); + PAGE_KERNEL, __pgprot(_PAGE_EXEC)); } #ifdef CONFIG_DEBUG_PAGEALLOC |