]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
riscv: define ILLEGAL_POINTER_VALUE for 64bit
authorJisheng Zhang <jszhang@kernel.org>
Fri, 5 Jul 2024 17:02:10 +0000 (01:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:03:58 +0000 (12:03 +0200)
commit 5c178472af247c7b50f962495bb7462ba453b9fb 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: fbe934d69eb7 ("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>
arch/riscv/Kconfig

index 939ea7f6a2289c72a6b3509f4073617d4475417d..846c0c4ac4dde3b03876f3fac19e52b12cee9cac 100644 (file)
@@ -319,6 +319,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