Skip to content

Commit 8947b7c

Browse files
Alexandre Ghitibjorn-rivos
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]> Signed-off-by: Björn Töpel <[email protected]>
1 parent b142d74 commit 8947b7c

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
@@ -378,7 +378,7 @@ int set_direct_map_invalid_noflush(struct page *page)
378378
int set_direct_map_default_noflush(struct page *page)
379379
{
380380
return __set_memory((unsigned long)page_address(page), 1,
381-
PAGE_KERNEL, __pgprot(0));
381+
PAGE_KERNEL, __pgprot(_PAGE_EXEC));
382382
}
383383

384384
#ifdef CONFIG_DEBUG_PAGEALLOC

0 commit comments

Comments
 (0)