riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Wed, 13 Dec 2023 13:40:27 +0000 (14:40 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 9 Jan 2024 18:59:08 +0000 (10:59 -0800)
commitb8b2711336f03ece539de61479d6ffc44fb603d3
treeaf5280e79a37f852f755fed68942588664a60e50
parent749b94b08005929bbc636df21a23322733166e35
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>
arch/riscv/mm/pageattr.c