vlad.tsyrklevich accepted this revision.
vlad.tsyrklevich added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/docs/ShadowCallStack.rst:12
 ShadowCallStack is an **experimental** instrumentation pass, currently only
 implemented for x86_64, that protects programs against return address
 overwrites (e.g. stack buffer overflows.) It works by saving a function's 
return
----------------
Should also mention aarch64 here.


================
Comment at: llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp:78
                                           CallingConv::ID CC) const {
+  bool SCS = MF.getFunction().hasFnAttribute(Attribute::ShadowCallStack);
   if (CC == CallingConv::GHC)
----------------
It's sort of a stretch to construct a scenario where this is likely to happen, 
but is it possible that a runtime function marked with 
`__attribute__((no_sanitize("shadowcallstack")))` would spill x18 across a 
function call because of this mask if it's referenced before and after? If that 
was a concern, we could make this test `hasAttr(SCS) || hasFlag(fFixedx18)`


https://reviews.llvm.org/D45239



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to