Skip to content

Commit

Permalink
riscv: define ILLEGAL_POINTER_VALUE for 64bit
Browse files Browse the repository at this point in the history
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 <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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
xhackerustc authored and gregkh committed Oct 17, 2024
1 parent 01cb2e7 commit 732b16e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ config GENERIC_HWEIGHT
config FIX_EARLYCON_MEM
def_bool MMU

config ILLEGAL_POINTER_VALUE
hex
default 0 if 32BIT
default 0xdead000000000000 if 64BIT

config PGTABLE_LEVELS
int
default 5 if 64BIT
Expand Down

0 comments on commit 732b16e

Please sign in to comment.