Files
linux/kernel
Andrey Konovalov 092c06519c FROMLIST: kasan, fork: reset pointer tags of vmapped stacks
[Combines a FROMGIT patch and FROMLIST fix for it.]

Once tag-based KASAN modes start tagging vmalloc() allocations, kernel
stacks start getting tagged if CONFIG_VMAP_STACK is enabled.

Reset the tag of kernel stack pointers after allocation in
alloc_thread_stack_node().

For SW_TAGS KASAN, when CONFIG_KASAN_STACK is enabled, the instrumentation
can't handle the SP register being tagged.

For HW_TAGS KASAN, there's no instrumentation-related issues.  However,
the impact of having a tagged SP register needs to be properly evaluated,
so keep it non-tagged for now.

Note, that the memory for the stack allocation still gets tagged to catch
vmalloc-into-stack out-of-bounds accesses.

Link: https://lkml.kernel.org/r/c6c96f012371ecd80e1936509ebcd3b07a5956f7.1643047180.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Acked-by: Marco Elver <elver@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
(cherry picked from commit 9d2dae85d689202c56068ce62e20821ad91c3606
 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm)
Link: https://lore.kernel.org/linux-mm/f50c5f96ef896d7936192c888b0c0a7674e33184.1644943792.git.andreyknvl@google.com/
Bug: 217222520
Change-Id: Ie723b03f1b857bc841cffc9a424b2791c97044a6
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2022-02-15 17:54:25 +01:00
..
2022-02-09 12:26:22 +01:00
2022-02-09 12:26:22 +01:00
2022-01-29 09:07:58 +01:00
2022-02-02 09:32:52 +01:00
2021-04-14 08:41:58 +02:00
2021-09-17 09:30:49 +02:00
2022-02-02 09:32:52 +01:00
2022-02-02 09:32:52 +01:00
2021-11-12 15:11:32 +01:00
2022-01-29 09:07:58 +01:00
2021-12-01 09:37:11 +01:00
2021-09-08 09:07:16 +02:00
2021-06-30 19:29:52 +02:00
2020-08-12 10:58:02 -07:00
2021-09-03 10:59:15 +02:00
2020-11-14 11:26:04 -08:00
2021-01-13 10:28:55 +01:00
2020-07-27 14:31:12 -04:00
2021-08-18 09:34:44 +02:00
2021-11-19 07:47:18 +01:00
2021-09-03 10:59:15 +02:00
2021-05-20 15:35:25 +02:00