[safestack] Don't crash if stack size is not aligned as expected

Summary:
From runtime side looks it's OK to RoundUpTo to needed alignment as buffer is
going to be RoundUpTo to page size anyway.

Reviewers: eugenis, pcc

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D57866

llvm-svn: 353475
This commit is contained in:
Vitaly Buka 2019-02-07 22:26:04 +00:00
parent 29874cea31
commit 6569120b81
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ INTERCEPTOR(int, pthread_create, pthread_t *thread,
}
SFS_CHECK(size);
SFS_CHECK((size & (kStackAlign - 1)) == 0);
size = RoundUpTo(size, kStackAlign);
SFS_CHECK((guard & (pageSize - 1)) == 0);
void *addr = unsafe_stack_alloc(size, guard);