scs: switch to vmapped shadow stacks
authorSami Tolvanen <samitolvanen@google.com>
Mon, 30 Nov 2020 23:34:41 +0000 (15:34 -0800)
committerWill Deacon <will@kernel.org>
Tue, 1 Dec 2020 10:30:28 +0000 (10:30 +0000)
commita2abe7cbd8fe2db5ff386c968e2273d9dc6c468d
tree7b00fd0f4e632398c41a56cf0ee4d001922c928f
parentf8394f232b1eab649ce2df5c5f15b0e528c92091
scs: switch to vmapped shadow stacks

The kernel currently uses kmem_cache to allocate shadow call stacks,
which means an overflows may not be immediately detected and can
potentially result in another task's shadow stack to be overwritten.

This change switches SCS to use virtually mapped shadow stacks for
tasks, which increases shadow stack size to a full page and provides
more robust overflow detection, similarly to VMAP_STACK.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201130233442.2562064-2-samitolvanen@google.com
Signed-off-by: Will Deacon <will@kernel.org>
include/linux/scs.h
kernel/scs.c