[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:23:05 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL353482: [safestack] Explain why tinfo at the end of the buffer (authored by vitalybuka, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D57863?vs=185878&id=185880#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D57863

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


Index: compiler-rt/trunk/lib/safestack/safestack.cc
===================================================================
--- compiler-rt/trunk/lib/safestack/safestack.cc
+++ compiler-rt/trunk/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 bytes 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.185880.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190207/8eb9490a/attachment.bin>


More information about the llvm-commits mailing list