llvm-project/llvm/test/Instrumentation
Marco Elver b8e49fdcb1 [AddressSanitizer] Allow prefixing memintrinsic calls in kernel mode
Allow receiving memcpy/memset/memmove instrumentation by using __asan or
__hwasan prefixed versions for AddressSanitizer and HWAddressSanitizer
respectively when compiling in kernel mode, by passing params
-asan-kernel-mem-intrinsic-prefix or -hwasan-kernel-mem-intrinsic-prefix.

By default the kernel-specialized versions of both passes drop the
prefixes for calls generated by memintrinsics. This assumes that all
locations that can lower the intrinsics to libcalls can safely be
instrumented. This unfortunately is not the case when implicit calls to
memintrinsics are inserted by the compiler in no_sanitize functions [1].

To solve the issue, normal memcpy/memset/memmove need to be
uninstrumented, and instrumented code should instead use the prefixed
versions. This also aligns with ASan behaviour in user space.

[1] https://lore.kernel.org/lkml/Yj2yYFloadFobRPx@lakrids/

Reviewed By: glider

Differential Revision: https://reviews.llvm.org/D122724
2022-03-31 11:14:42 +02:00
..
AddressSanitizer [AddressSanitizer] Allow prefixing memintrinsic calls in kernel mode 2022-03-31 11:14:42 +02:00
BoundsChecking [SanitizerBounds] Add support for NoSanitizeBounds function 2022-03-01 18:47:02 +01:00
DataFlowSanitizer [DFSan] Remove trampolines to unblock opaque pointers. (Reland with fix) 2022-03-14 16:03:25 -07:00
HWAddressSanitizer [AddressSanitizer] Allow prefixing memintrinsic calls in kernel mode 2022-03-31 11:14:42 +02:00
HeapProfiler [MemProf] Don't instrument stack accesses unless requested 2021-09-16 12:21:51 -07:00
InstrOrderFile
InstrProfiling [NVPTX][tests] Do not run tests that require direct object generation 2022-03-22 16:46:48 +04:00
JustMyCode [JMCInstrument] infer proper path style based on debug info 2022-03-10 10:50:44 -08:00
MemorySanitizer Reapply "[Intrinsics] Add `nocallback` to the default intrinsic attributes" 2022-03-25 09:36:50 -05:00
PoisonChecking
SanitizerCoverage [sancov] Don't instrument calls to bitcast funcs: they're not indirect. 2022-03-07 12:43:37 -08:00
ThreadSanitizer tsan: don't consider debug calls as calls 2021-11-17 14:42:16 +01:00
cgprofile.ll [CGProfile] Don't emit call graph profile edges with zero weight 2021-10-28 11:32:49 -04:00