Skip to content

Commit b8b2711

Browse files
Alexandre Ghitipalmer-dabbelt
authored andcommitted
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: 395a21f ("riscv: add ARCH_HAS_SET_DIRECT_MAP support") Signed-off-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 749b94b commit b8b2711

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/mm/pageattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ int set_direct_map_invalid_noflush(struct page *page)
383383
int set_direct_map_default_noflush(struct page *page)
384384
{
385385
return __set_memory((unsigned long)page_address(page), 1,
386-
PAGE_KERNEL, __pgprot(0));
386+
PAGE_KERNEL, __pgprot(_PAGE_EXEC));
387387
}
388388

389389
#ifdef CONFIG_DEBUG_PAGEALLOC

0 commit comments

Comments
 (0)