Re: [PATCH 4/7] x86/entry: Increase entry_stack size to a full page

From: Lai Jiangshan
Date: Thu Jun 18 2020 - 23:10:59 EST


On Fri, Jun 19, 2020 at 4:37 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> Marco crashed in bad_iret with a Clang11/KCSAN build due to
> overflowing the stack. Now that we run C code on it, expand it to a
> full page.

Some of my experimental code also once got crashed due to overflowing
the stack. I'm glad to have the stack expanded, thanks.

Reviewed-by: Lai Jiangshan <jiangshanlai@xxxxxxxxx>

>
> Suggested-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
> Reported-by: Marco Elver <elver@xxxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---
> arch/x86/include/asm/processor.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/arch/x86/include/asm/processor.h
> +++ b/arch/x86/include/asm/processor.h
> @@ -370,7 +370,7 @@ struct x86_hw_tss {
> #define IO_BITMAP_OFFSET_INVALID (__KERNEL_TSS_LIMIT + 1)
>
> struct entry_stack {
> - unsigned long words[64];
> + char stack[PAGE_SIZE];
> };
>
> struct entry_stack_page {
>
>