Skip to content

Commit 859c6b1

Browse files
xhackerustcmehmetb0
authored andcommitted
riscv: define ILLEGAL_POINTER_VALUE for 64bit
BugLink: https://bugs.launchpad.net/bugs/2086242 commit 5c17847 upstream. 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 <[email protected]> Fixes: fbe934d ("RISC-V: Build Infrastructure") Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Koichiro Den <[email protected]> Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent d54ae7f commit 859c6b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/riscv/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ config GENERIC_HWEIGHT
210210
config FIX_EARLYCON_MEM
211211
def_bool MMU
212212

213+
config ILLEGAL_POINTER_VALUE
214+
hex
215+
default 0 if 32BIT
216+
default 0xdead000000000000 if 64BIT
217+
213218
config PGTABLE_LEVELS
214219
int
215220
default 3 if 64BIT

0 commit comments

Comments
 (0)