Lines Matching full:stack
9 // This file implements the runtime support for the safe stack protection
10 // mechanism. The runtime manages allocation/deallocation of the unsafe stack
51 // TODO: To make accessing the unsafe stack pointer faster, we plan to
54 // the same mechanism as currently being used by the traditional stack
55 // protector pass to store the stack guard (see getStackCookieLocation()
67 // TODO: The runtime library does not currently protect the safe stack beyond
68 // relying on the system-enforced ASLR. The protection of the (safe) stack can
72 // architectures: the (safe) stack segment (implicitly accessed via the %ss
78 // to access the safe stack can be prevented from doing so through runtime
79 // instrumentation. One way to do it is to allocate the safe stack(s) in the
82 // stack.
85 // of the safe stack(s) can be randomized through secure mechanisms, and the
86 // leakage of the stack pointer can be prevented. Currently, libc can leak the
87 // stack pointer in several ways (e.g. in longjmp, signal handling, user-level
90 // the stack pointer (i.e., %rsp) when that's possible, or by using
91 // encryption/PTR_MANGLE (XOR-ing the dumped stack pointer with another secret
94 // generation to make sure that the stack pointer is never written to memory,
95 // or if it is, its written on the safe stack.
97 // Finally, while the Unsafe Stack pointer is currently stored in a thread
103 /// Minimum stack alignment for the unsafe stack.
106 /// Default size of the unsafe stack. This value is only used if the stack
110 // Per-thread unsafe stack information. It's not frequently accessed, so there
140 /// Safe stack per-thread information passed to the thread_start function
150 /// Wrap the thread function in order to deallocate the unsafe stack when the
158 // Setup the unsafe stack; this will destroy tinfo content
168 /// Linked list used to store exiting threads stack/thread information.
182 /// Thread-specific data destructor. We want to free the unsafe stack only after
202 thread_stack_ll *stack = *stackp;
203 if (stack->pid != pid ||
204 (-1 == TgKill(stack->pid, stack->tid, 0) && errno == ESRCH)) {
205 Munmap(stack->stack_base, stack->size);
206 *stackp = stack->next;
207 free(stack);
209 stackp = &stack->next;
220 // Merge thread_stacks with the current thread's stack and any remaining
232 /// Intercept thread creation operation to allocate and setup the unsafe stack
244 // get pthread default stack size
302 // Determine the stack size for the main thread.
310 // Allocate unsafe stack for main thread