[PATCH] RISC-V: Double the stack size on rv64

Palmer Dabbelt palmerdabbelt at google.com
Mon Jul 13 21:19:23 EDT 2020


This was suggested in the syzkaller thread as a fix for a bunch of issues.  It
seems in line with what other architectures are doing, and while I haven't
personally figured out how to reproduce the issues they seem believable enough
to just change it.

Fixes: 7db91e57a0ac ("RISC-V: Task implementation")
Cc: stable at vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmerdabbelt at google.com>
---
I've put this on fixes as I don't see a patch from anyone on that thread, and
it seems straight-forward enough to just do it.  If there's any issues I'm
happy to listen, otherwise this is going up later this week.
---
 arch/riscv/include/asm/thread_info.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h
index 1dd12a0cbb2b..2026076b1d30 100644
--- a/arch/riscv/include/asm/thread_info.h
+++ b/arch/riscv/include/asm/thread_info.h
@@ -12,7 +12,11 @@
 #include <linux/const.h>
 
 /* thread information allocation */
+#if defined(CONFIG_32BIT)
 #define THREAD_SIZE_ORDER	(1)
+#elif defined(CONFIG_64BIT)
+#define THREAD_SIZE_ORDER   (2)
+#endif
 #define THREAD_SIZE		(PAGE_SIZE << THREAD_SIZE_ORDER)
 
 #ifndef __ASSEMBLY__
-- 
2.27.0.389.gc38d7665816-goog




More information about the linux-riscv mailing list