[PATCH] D18846: [safestack] Add canary to unsafe stack frames
Tim Shen via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 8 13:44:09 PDT 2016
timshen added inline comments.
================
Comment at: lib/CodeGen/SafeStack.cpp:399
@@ +398,3 @@
+ StackGuardVar =
+ F.getParent()->getOrInsertGlobal("__stack_chk_guard", StackPtrTy);
+ return IRB.CreateLoad(StackGuardVar, "StackGuard");
----------------
timshen wrote:
> Is this going to work correctly, for say, PowerPC? As of my knowledge on powerpc64le-linux-gnu, there is no "__stack_chk_guard", but similarly has a data member in TCB.
>
> On SSP side I'm actively working on supporting PowerPC - more generally, allowing backends to lower LOAD_STACK_GUARD node manually.
To be specific, powerpc64le-linux-gnu is similar to AArch64, which has a stack guard as data member in TCB.
================
Comment at: lib/CodeGen/SafeStack.cpp:504
@@ +503,3 @@
+ Constant *StackChkFail = F.getParent()->getOrInsertFunction(
+ "__stack_chk_fail", IRB.getVoidTy(), nullptr);
+ IRBFail.CreateCall(StackChkFail, {});
----------------
timshen wrote:
> OpenBSD doesn't have __stack_chk_fail. It has StackProtector::CreateFailBB.
>
> I wonder if it's easy to share some code between SSP and safestack, though I have no idea what safestack is doing.
s/It has StackProtector::CreateFailBB/See StackProtector::CreateFailBB/.
Repository:
rL LLVM
http://reviews.llvm.org/D18846
More information about the llvm-commits
mailing list