|
Message-ID: <60ec3a49-7b71-df31-f231-b48ff135b718@infradead.org> Date: Tue, 18 Feb 2020 20:19:56 -0800 From: Randy Dunlap <rdunlap@...radead.org> To: Sami Tolvanen <samitolvanen@...gle.com>, Will Deacon <will@...nel.org>, Catalin Marinas <catalin.marinas@....com>, Steven Rostedt <rostedt@...dmis.org>, Masami Hiramatsu <mhiramat@...nel.org>, Ard Biesheuvel <ard.biesheuvel@...aro.org>, Mark Rutland <mark.rutland@....com>, james.morse@....com Cc: Dave Martin <Dave.Martin@....com>, Kees Cook <keescook@...omium.org>, Laura Abbott <labbott@...hat.com>, Marc Zyngier <maz@...nel.org>, Nick Desaulniers <ndesaulniers@...gle.com>, Jann Horn <jannh@...gle.com>, Miguel Ojeda <miguel.ojeda.sandonis@...il.com>, Masahiro Yamada <yamada.masahiro@...ionext.com>, clang-built-linux@...glegroups.com, kernel-hardening@...ts.openwall.com, linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH v8 01/12] add support for Clang's Shadow Call Stack (SCS) Hi Sami, a couple of minor tweaks: On 2/18/20 4:08 PM, Sami Tolvanen wrote: > diff --git a/arch/Kconfig b/arch/Kconfig > index 98de654b79b3..66b34fd0df54 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -526,6 +526,40 @@ config STACKPROTECTOR_STRONG > about 20% of all kernel functions, which increases the kernel code > size by about 2%. > > +config ARCH_SUPPORTS_SHADOW_CALL_STACK > + bool > + help > + An architecture should select this if it supports Clang's Shadow > + Call Stack, has asm/scs.h, and implements runtime support for shadow > + stack switching. > + > +config SHADOW_CALL_STACK > + bool "Clang Shadow Call Stack" > + depends on ARCH_SUPPORTS_SHADOW_CALL_STACK > + help > + This option enables Clang's Shadow Call Stack, which uses a > + shadow stack to protect function return addresses from being > + overwritten by an attacker. More information can be found from found in > + Clang's documentation: > + > + https://clang.llvm.org/docs/ShadowCallStack.html > + > + Note that security guarantees in the kernel differ from the ones > + documented for user space. The kernel must store addresses of shadow > + stacks used by other tasks and interrupt handlers in memory, which > + means an attacker capable reading and writing arbitrary memory may capable of > + be able to locate them and hijack control flow by modifying shadow > + stacks that are not currently in use. > + > +config SHADOW_CALL_STACK_VMAP > + bool "Use virtually mapped shadow call stacks" > + depends on SHADOW_CALL_STACK > + help > + Use virtually mapped shadow call stacks. Selecting this option > + provides better stack exhaustion protection, but increases per-thread > + memory consumption as a full page is allocated for each shadow stack. > + > + > config HAVE_ARCH_WITHIN_STACK_FRAMES > bool > help thanks. -- ~Randy
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.