Lines Matching refs:guard
95 static inline void *unsafe_stack_alloc(size_t size, size_t guard) { in unsafe_stack_alloc() argument
96 CHECK_GE(size + guard, size); in unsafe_stack_alloc()
97 void *addr = MmapOrDie(size + guard, "unsafe_stack_alloc"); in unsafe_stack_alloc()
98 MprotectNoAccess((uptr)addr, (uptr)guard); in unsafe_stack_alloc()
99 return (char *)addr + guard; in unsafe_stack_alloc()
102 static inline void unsafe_stack_setup(void *start, size_t size, size_t guard) { in unsafe_stack_setup() argument
104 CHECK_GE((char *)start + guard, (char *)start); in unsafe_stack_setup()
111 unsafe_stack_guard = guard; in unsafe_stack_setup()
176 size_t guard = 0; in INTERCEPTOR() local
180 pthread_attr_getguardsize(attr, &guard); in INTERCEPTOR()
186 pthread_attr_getguardsize(&tmpattr, &guard); in INTERCEPTOR()
192 CHECK_EQ((guard & (pageSize - 1)), 0); in INTERCEPTOR()
194 void *addr = unsafe_stack_alloc(size, guard); in INTERCEPTOR()
201 tinfo->unsafe_stack_guard = guard; in INTERCEPTOR()
214 size_t guard = 4096; in __safestack_init() local
221 void *addr = unsafe_stack_alloc(size, guard); in __safestack_init()
223 unsafe_stack_setup(addr, size, guard); in __safestack_init()