[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:20:11 PST 2019
vitalybuka updated this revision to Diff 185878.
vitalybuka added a comment.
typo
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 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.185878.patch
Type: text/x-patch
Size: 587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190207/e4fbfcb7/attachment.bin>
More information about the llvm-commits
mailing list