[PATCH] D57863: [safestack] Explain why tinfo at the end of the buffer

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 15:18:32 PST 2019


vitalybuka updated this revision to Diff 185877.
vitalybuka added a comment.

do nothing


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57863

Files:
  compiler-rt/lib/safestack/safestack.cc


Index: compiler-rt/lib/safestack/safestack.cc
===================================================================
--- compiler-rt/lib/safestack/safestack.cc
+++ compiler-rt/lib/safestack/safestack.cc
@@ -228,6 +228,8 @@
   size = RoundUpTo(size, kStackAlign);
 
   void *addr = unsafe_stack_alloc(size, guard);
+  // Put tinfo at the end of the buffer. guard may be not page aligned.
+  // If that is so then some bytest after addr can be mprotected.
   struct tinfo *tinfo =
       (struct tinfo *)(((char *)addr) + size - sizeof(struct tinfo));
   tinfo->start_routine = start_routine;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57863.185877.patch
Type: text/x-patch
Size: 588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190207/84548f20/attachment.bin>


More information about the llvm-commits mailing list