Skip to content

Commit 5c17847

Browse files
xhackerustcpalmer-dabbelt
authored andcommitted
riscv: define ILLEGAL_POINTER_VALUE for 64bit
This is used in poison.h for poison pointer offset. Based on current SV39, SV48 and SV57 vm layout, 0xdead000000000000 is a proper value that is not mappable, this can avoid potentially turning an oops to an expolit. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Fixes: fbe934d ("RISC-V: Build Infrastructure") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240705170210.3236-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent d6a1928 commit 5c17847

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

arch/riscv/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ config GENERIC_HWEIGHT
320320
config FIX_EARLYCON_MEM
321321
def_bool MMU
322322

323+
config ILLEGAL_POINTER_VALUE
324+
hex
325+
default 0 if 32BIT
326+
default 0xdead000000000000 if 64BIT
327+
323328
config PGTABLE_LEVELS
324329
int
325330
default 5 if 64BIT

0 commit comments

Comments
 (0)