[PATCH -tip v4 1/3] kasan: Emit different calls for instrumentable memintrinsics

From: Naresh Kamboju
Date: Fri Feb 17 2023 - 12:37:36 EST


> Clang 15 provides an option to prefix memcpy/memset/memmove calls with
> __asan_/__hwasan_ in instrumented functions: https://reviews.llvm.org/D122724

> GCC will add support in future:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108777

> Use it to regain KASAN instrumentation of memcpy/memset/memmove on
> architectures that require noinstr to be really free from instrumented
> mem*() functions (all GENERIC_ENTRY architectures).

> Fixes: 69d4c0d32186 ("entry, kasan, x86: Disallow overriding mem*() functions")
> Signed-off-by: Marco Elver <elver@xxxxxxxxxx>
> Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

Tested-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>
Tested-by: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx>


Tested Kunit tests with clang-15, clang-16 and gcc-12 the reported
issues got fixed.

ref:
https://lkft.validation.linaro.org/scheduler/job/6172341#L618
https://lkft.validation.linaro.org/scheduler/job/6172351#L618
https://lkft.validation.linaro.org/scheduler/job/6172338#L618

https://lore.kernel.org/all/CA+G9fYvZqytp3gMnC4-no9EB=Jnzqmu44i8JQo6apiZat-xxPg@xxxxxxxxxxxxxx/

--
Linaro LKFT
https://lkft.linaro.org