Lines Matching full:stack
6 * using an alternate signal stack, with the default pkey (pkey 0) disabled.
80 static inline long clone_raw(unsigned long flags, void *stack, in clone_raw() argument
84 long a2 = (long)stack; in clone_raw()
173 /* After we disable MPK 0, we can't access the stack to return */ in thread_segv_pkuerr_stack()
179 stack_t *stack = ptr; in thread_segv_maperr_ptr() local
183 * Setup alternate signal stack, which should be pkey_mprotect()ed by in thread_segv_maperr_ptr()
184 * MPK 0. The thread's stack cannot be used for signals because it is in thread_segv_maperr_ptr()
187 syscall_raw(SYS_sigaltstack, (long)stack, 0, 0, 0, 0, 0); in thread_segv_maperr_ptr()
202 * Note that the new thread stack and the alternate signal stack is
240 * Note that the new thread stack and the alternate signal stack is
278 * Verify that the sigsegv handler that uses an alternate signal stack
280 * its own stack, and disables all other MPKs (including 0).
286 void *stack; in test_sigsegv_handler_with_different_pkey_for_stack() local
302 stack = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, in test_sigsegv_handler_with_different_pkey_for_stack()
305 assert(stack != MAP_FAILED); in test_sigsegv_handler_with_different_pkey_for_stack()
313 /* Protect the new stack with MPK 1 */ in test_sigsegv_handler_with_different_pkey_for_stack()
315 sys_mprotect_pkey(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); in test_sigsegv_handler_with_different_pkey_for_stack()
317 /* Set up alternate signal stack that will use the default MPK */ in test_sigsegv_handler_with_different_pkey_for_stack()
330 stack + STACK_SIZE, in test_sigsegv_handler_with_different_pkey_for_stack()
398 * the stack and the code could access it via an offset from the program in thread_sigusr2_self()
399 * counter. This makes sure it's on the function's stack frame. in thread_sigusr2_self()
405 stack_t *stack = ptr; in thread_sigusr2_self() local
409 * Setup alternate signal stack, which should be pkey_mprotect()ed by in thread_sigusr2_self()
410 * MPK 0. The thread's stack cannot be used for signals because it is in thread_sigusr2_self()
413 syscall(SYS_sigaltstack, (long)stack, 0, 0, 0, 0, 0); in thread_sigusr2_self()
427 * will attempt to use a %rbp value which is on the stack in thread_sigusr2_self()
442 void *stack; in test_pkru_sigreturn() local
470 stack = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, in test_pkru_sigreturn()
473 assert(stack != MAP_FAILED); in test_pkru_sigreturn()
477 * later in this flow) will have its stack protected by MPK 2, whereas in test_pkru_sigreturn()
478 * the current thread's stack is protected by the default MPK 0. Hence in test_pkru_sigreturn()
486 /* Protect the stack with MPK 2 */ in test_pkru_sigreturn()
488 sys_mprotect_pkey(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); in test_pkru_sigreturn()
490 /* Set up alternate signal stack that will use the default MPK */ in test_pkru_sigreturn()
501 stack + STACK_SIZE, in test_pkru_sigreturn()