Fix up the custom KASAN instrumentation for Shadow Call Stack to support vmalloc() mappings and pointers being tagged. - Use the tagged pointer returned by kasan_unpoison_vmalloc() in __scs_alloc() when calling memset() to avoid false-positives. - Do not return a tagged Shadow Call Stack pointer from __scs_alloc(), as this might lead to conflicts with the instrumentation. Link: https://lkml.kernel.org/r/2f6605e3a358cf64d73a05710cb3da356886ad29.1646233925.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Cc: Marco Elver <elver@google.com> Cc: Alexander Potapenko <glider@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 bd2c296805cff9572080bf56807c16d1dd382260 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm) Link: https://lore.kernel.org/all/2f6605e3a358cf64d73a05710cb3da356886ad29.1646233925.git.andreyknvl@google.com/ Bug: 217222520 Bug: 222221793 Change-Id: I9e6e4cd303e0815a5b092ba6ec28638bd1f7bc2c Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2.9 KiB
2.9 KiB