]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2024 15:41:50 +0000 (17:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2024 15:41:50 +0000 (17:41 +0200)
added patches:
riscv-define-illegal_pointer_value-for-64bit.patch

queue-4.19/riscv-define-illegal_pointer_value-for-64bit.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/riscv-define-illegal_pointer_value-for-64bit.patch b/queue-4.19/riscv-define-illegal_pointer_value-for-64bit.patch
new file mode 100644 (file)
index 0000000..3de059d
--- /dev/null
@@ -0,0 +1,38 @@
+From 5c178472af247c7b50f962495bb7462ba453b9fb Mon Sep 17 00:00:00 2001
+From: Jisheng Zhang <jszhang@kernel.org>
+Date: Sat, 6 Jul 2024 01:02:10 +0800
+Subject: riscv: define ILLEGAL_POINTER_VALUE for 64bit
+
+From: Jisheng Zhang <jszhang@kernel.org>
+
+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 |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/arch/riscv/Kconfig
++++ b/arch/riscv/Kconfig
+@@ -84,6 +84,11 @@ config GENERIC_CSUM
+ config GENERIC_HWEIGHT
+       def_bool y
++config ILLEGAL_POINTER_VALUE
++      hex
++      default 0 if 32BIT
++      default 0xdead000000000000 if 64BIT
++
+ config PGTABLE_LEVELS
+       int
+       default 3 if 64BIT
index 9c7be57cb4f5b0f0fd925ab9bb100e650493c8a8..ce0e2e450f039af9d4ada9b7124bf789ac0294e6 100644 (file)
@@ -202,3 +202,4 @@ ocfs2-cancel-dqi_sync_work-before-freeing-oinfo.patch
 ocfs2-remove-unreasonable-unlock-in-ocfs2_read_blocks.patch
 ocfs2-fix-null-ptr-deref-when-journal-load-failed.patch
 ocfs2-fix-possible-null-ptr-deref-in-ocfs2_set_buffer_uptodate.patch
+riscv-define-illegal_pointer_value-for-64bit.patch