Lines Matching full:stack
6 * using an alternate signal stack, with the default pkey (pkey 0) disabled.
128 /* After we disable MPK 0, we can't access the stack to return */ in thread_segv_pkuerr_stack()
134 stack_t *stack = ptr; in thread_segv_maperr_ptr() local
138 * Setup alternate signal stack, which should be pkey_mprotect()ed by in thread_segv_maperr_ptr()
139 * MPK 0. The thread's stack cannot be used for signals because it is in thread_segv_maperr_ptr()
142 syscall_raw(SYS_sigaltstack, (long)stack, 0, 0, 0, 0, 0); in thread_segv_maperr_ptr()
155 * Note that the new thread stack and the alternate signal stack is
193 * Note that the new thread stack and the alternate signal stack is
231 * Verify that the sigsegv handler that uses an alternate signal stack
233 * its own stack, and disables all other MPKs (including 0).
239 void *stack; in test_sigsegv_handler_with_different_pkey_for_stack() local
254 stack = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, in test_sigsegv_handler_with_different_pkey_for_stack()
257 assert(stack != MAP_FAILED); in test_sigsegv_handler_with_different_pkey_for_stack()
262 /* Protect the new stack with MPK 1 */ in test_sigsegv_handler_with_different_pkey_for_stack()
264 pkey_mprotect(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); in test_sigsegv_handler_with_different_pkey_for_stack()
266 /* Set up alternate signal stack that will use the default MPK */ in test_sigsegv_handler_with_different_pkey_for_stack()
280 (long) ((char *)(stack) + STACK_SIZE), in test_sigsegv_handler_with_different_pkey_for_stack()
342 * the stack and the code could access it via an offset from the program in thread_sigusr2_self()
343 * counter. This makes sure it's on the function's stack frame. in thread_sigusr2_self()
349 stack_t *stack = ptr; in thread_sigusr2_self() local
352 * Setup alternate signal stack, which should be pkey_mprotect()ed by in thread_sigusr2_self()
353 * MPK 0. The thread's stack cannot be used for signals because it is in thread_sigusr2_self()
356 syscall(SYS_sigaltstack, (long)stack, 0, 0, 0, 0, 0); in thread_sigusr2_self()
368 * will attempt to use a %rbp value which is on the stack in thread_sigusr2_self()
383 void *stack; in test_pkru_sigreturn() local
410 stack = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, in test_pkru_sigreturn()
413 assert(stack != MAP_FAILED); in test_pkru_sigreturn()
417 * later in this flow) will have its stack protected by MPK 2, whereas in test_pkru_sigreturn()
418 * the current thread's stack is protected by the default MPK 0. Hence in test_pkru_sigreturn()
423 /* Protect the stack with MPK 2 */ in test_pkru_sigreturn()
425 pkey_mprotect(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); in test_pkru_sigreturn()
427 /* Set up alternate signal stack that will use the default MPK */ in test_pkru_sigreturn()
439 (long) ((char *)(stack) + STACK_SIZE), in test_pkru_sigreturn()