[safestack] Explain why tinfo at the end of the buffer
Reviewers: pcc, eugenis, vlad.tsyrklevich Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, jfb, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57863 llvm-svn: 353482
This commit is contained in:
parent
539e6aa421
commit
871b2bd980
|
@ -228,6 +228,8 @@ INTERCEPTOR(int, pthread_create, pthread_t *thread,
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue