forked from OSchip/llvm-project
[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:
parent
29874cea31
commit
6569120b81
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue