Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 28 Feb 2020 12:51:09 -0800
From: Sami Tolvanen <>
To: James Morse <>
Cc: Will Deacon <>, Catalin Marinas <>, 
	Steven Rostedt <>, Masami Hiramatsu <>, 
	Ard Biesheuvel <>, Mark Rutland <>, 
	Dave Martin <>, Kees Cook <>, 
	Laura Abbott <>, Marc Zyngier <>, 
	Nick Desaulniers <>, Jann Horn <>, 
	Miguel Ojeda <>, 
	Masahiro Yamada <>, 
	clang-built-linux <>, 
	Kernel Hardening <>, 
	linux-arm-kernel <>, LKML <>
Subject: Re: [PATCH v9 10/12] arm64: implement Shadow Call Stack

On Fri, Feb 28, 2020 at 8:31 AM James Morse <> wrote:
> > +#ifndef __ASSEMBLY__
> As the whole file is guarded by this, why do you need to include it in assembly files at all?

True, the include in head.S is not needed. I'll remove it in the next version.

> > +static inline void scs_overflow_check(struct task_struct *tsk)
> > +{
> > +     if (unlikely(scs_corrupted(tsk)))
> > +             panic("corrupted shadow stack detected inside scheduler\n");
> Could this ever catch anything with CONFIG_SHADOW_CALL_STACK_VMAP?
> Wouldn't we have hit the vmalloc guard page at the point of overflow?

With CONFIG_SHADOW_CALL_STACK_VMAP, even though we allocate a full
page, SCS_SIZE is still 1k, so we should catch overflows here well
before we hit the guard page.

> It would be nice to have a per-cpu stack that we switch to when on the overflow stack.

It shouldn't be a problem to add an overflow shadow stack if you think
one is needed.

> I can't work out why this needs to be before before idle_task_exit()...
> It needs to run before init_idle(), which calls scs_task_reset(), but all that is on the
> cpu_up() path. (if it is to pair those up, any reason core code can't do both?)

At this point, the idle task's shadow stack pointer is only stored in
x18, so we need to save it again to thread_info before the CPU shuts
down, or we'll lose the pointer.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.