[PATCH] D108377: [asan] Implemented custom calling convention similar used by HWASan for X86.

Vitaly Buka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 19 11:14:41 PDT 2021


vitalybuka added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:571
+      getShadowMapping(TargetTriple, M.getDataLayout().getPointerSizeInBits(),
+                       ClEnableKasan.getNumOccurrences() > 0);
+  *ShadowBase = Mapping.Offset;
----------------
Unfortunately we need Kernel as argument, similar to RecoverShift in HWAsan.
Look at CL flags as internal per process constants. So if value is controlled by them then it's OK to assume the same value.
Kernel value however can be set by fronted e.g. from clang and does not match ClEnableKasan.

I propose to have own set of intrinsics for kernel/non-kernel to avoid fancy bit packing or unreadable 1/0 arguments.
Later we can cleunup hwasan as well.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108377/new/

https://reviews.llvm.org/D108377



More information about the cfe-commits mailing list