* [PATCH] riscv: Increase stack size under KASAN
@ 2022-03-14 9:06 Dmitry Vyukov
2022-03-21 14:59 ` Dmitry Vyukov
2022-03-31 5:52 ` Palmer Dabbelt
0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Vyukov @ 2022-03-14 9:06 UTC (permalink / raw)
To: paul.walmsley, palmer, aou, alexandre.ghiti
Cc: Dmitry Vyukov, syzbot+0600986d88e2d4d7ebb8, linux-riscv, kasan-dev
KASAN requires more stack space because of compiler instrumentation.
Increase stack size as other arches do.
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Reported-by: syzbot+0600986d88e2d4d7ebb8@syzkaller.appspotmail.com
Cc: linux-riscv@lists.infradead.org
Cc: kasan-dev@googlegroups.com
---
arch/riscv/include/asm/thread_info.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h
index 60da0dcacf145..74d888c8d631a 100644
--- a/arch/riscv/include/asm/thread_info.h
+++ b/arch/riscv/include/asm/thread_info.h
@@ -11,11 +11,17 @@
#include <asm/page.h>
#include <linux/const.h>
+#ifdef CONFIG_KASAN
+#define KASAN_STACK_ORDER 1
+#else
+#define KASAN_STACK_ORDER 0
+#endif
+
/* thread information allocation */
#ifdef CONFIG_64BIT
-#define THREAD_SIZE_ORDER (2)
+#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER)
#else
-#define THREAD_SIZE_ORDER (1)
+#define THREAD_SIZE_ORDER (1 + KASAN_STACK_ORDER)
#endif
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
base-commit: 0966d385830de3470b7131db8e86c0c5bc9c52dc
--
2.35.1.723.g4982287a31-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] riscv: Increase stack size under KASAN
2022-03-14 9:06 [PATCH] riscv: Increase stack size under KASAN Dmitry Vyukov
@ 2022-03-21 14:59 ` Dmitry Vyukov
2022-03-31 5:52 ` Palmer Dabbelt
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Vyukov @ 2022-03-21 14:59 UTC (permalink / raw)
To: paul.walmsley, palmer, aou, alexandre.ghiti
Cc: syzbot+0600986d88e2d4d7ebb8, linux-riscv, kasan-dev
On Mon, 14 Mar 2022 at 10:06, Dmitry Vyukov <dvyukov@google.com> wrote:
>
> KASAN requires more stack space because of compiler instrumentation.
> Increase stack size as other arches do.
>
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> Reported-by: syzbot+0600986d88e2d4d7ebb8@syzkaller.appspotmail.com
> Cc: linux-riscv@lists.infradead.org
> Cc: kasan-dev@googlegroups.com
ping
> ---
> arch/riscv/include/asm/thread_info.h | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h
> index 60da0dcacf145..74d888c8d631a 100644
> --- a/arch/riscv/include/asm/thread_info.h
> +++ b/arch/riscv/include/asm/thread_info.h
> @@ -11,11 +11,17 @@
> #include <asm/page.h>
> #include <linux/const.h>
>
> +#ifdef CONFIG_KASAN
> +#define KASAN_STACK_ORDER 1
> +#else
> +#define KASAN_STACK_ORDER 0
> +#endif
> +
> /* thread information allocation */
> #ifdef CONFIG_64BIT
> -#define THREAD_SIZE_ORDER (2)
> +#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER)
> #else
> -#define THREAD_SIZE_ORDER (1)
> +#define THREAD_SIZE_ORDER (1 + KASAN_STACK_ORDER)
> #endif
> #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
>
>
> base-commit: 0966d385830de3470b7131db8e86c0c5bc9c52dc
> --
> 2.35.1.723.g4982287a31-goog
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] riscv: Increase stack size under KASAN
2022-03-14 9:06 [PATCH] riscv: Increase stack size under KASAN Dmitry Vyukov
2022-03-21 14:59 ` Dmitry Vyukov
@ 2022-03-31 5:52 ` Palmer Dabbelt
1 sibling, 0 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2022-03-31 5:52 UTC (permalink / raw)
To: dvyukov
Cc: Paul Walmsley, aou, alexandre.ghiti, dvyukov,
syzbot+0600986d88e2d4d7ebb8, linux-riscv, kasan-dev
On Mon, 14 Mar 2022 02:06:52 PDT (-0700), dvyukov@google.com wrote:
> KASAN requires more stack space because of compiler instrumentation.
> Increase stack size as other arches do.
>
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> Reported-by: syzbot+0600986d88e2d4d7ebb8@syzkaller.appspotmail.com
> Cc: linux-riscv@lists.infradead.org
> Cc: kasan-dev@googlegroups.com
> ---
> arch/riscv/include/asm/thread_info.h | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h
> index 60da0dcacf145..74d888c8d631a 100644
> --- a/arch/riscv/include/asm/thread_info.h
> +++ b/arch/riscv/include/asm/thread_info.h
> @@ -11,11 +11,17 @@
> #include <asm/page.h>
> #include <linux/const.h>
>
> +#ifdef CONFIG_KASAN
> +#define KASAN_STACK_ORDER 1
> +#else
> +#define KASAN_STACK_ORDER 0
> +#endif
> +
> /* thread information allocation */
> #ifdef CONFIG_64BIT
> -#define THREAD_SIZE_ORDER (2)
> +#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER)
> #else
> -#define THREAD_SIZE_ORDER (1)
> +#define THREAD_SIZE_ORDER (1 + KASAN_STACK_ORDER)
> #endif
> #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
>
>
> base-commit: 0966d385830de3470b7131db8e86c0c5bc9c52dc
Thanks, this is on for-next (there's no fixes right now, I'm still
collecting stuff for this merge window).
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-31 5:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 9:06 [PATCH] riscv: Increase stack size under KASAN Dmitry Vyukov
2022-03-21 14:59 ` Dmitry Vyukov
2022-03-31 5:52 ` Palmer Dabbelt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).