[compiler-rt] r353475 - [safestack] Don't crash if stack size is not aligned as expected
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 7 14:26:04 PST 2019
Author: vitalybuka
Date: Thu Feb 7 14:26:04 2019
New Revision: 353475
URL: http://llvm.org/viewvc/llvm-project?rev=353475&view=rev
Log:
[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
Modified:
compiler-rt/trunk/lib/safestack/safestack.cc
Modified: compiler-rt/trunk/lib/safestack/safestack.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/safestack/safestack.cc?rev=353475&r1=353474&r2=353475&view=diff
==============================================================================
--- compiler-rt/trunk/lib/safestack/safestack.cc (original)
+++ compiler-rt/trunk/lib/safestack/safestack.cc Thu Feb 7 14:26:04 2019
@@ -228,7 +228,7 @@ INTERCEPTOR(int, pthread_create, pthread
}
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);
More information about the llvm-commits
mailing list