Lines Matching +full:pre +full:- +full:programs
1 // SPDX-License-Identifier: GPL-2.0
6 * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson
7 * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes
8 * 2000-2002 x86-64 support by Andi Kleen
25 #include <linux/user-return-notifier.h>
28 #include <linux/entry-common.h>
49 ksig->ka.sa.sa_flags & SA_IA32_ABI; in is_ia32_compat_frame()
60 ksig->ka.sa.sa_flags & SA_X32_ABI; in is_x32_frame()
85 /* x86 ABI requires 16-byte alignment */
88 #define MAX_FRAME_PADDING (FRAME_ALIGNMENT - 1)
97 struct k_sigaction *ka = &ksig->ka; in get_sigframe()
100 bool nested_altstack = on_sig_stack(regs->sp); in get_sigframe()
103 unsigned long sp = regs->sp; in get_sigframe()
109 sp -= 128; in get_sigframe()
112 if (ka->sa.sa_flags & SA_ONSTACK) { in get_sigframe()
115 * programs use SS_AUTODISARM, which disables that check, and in get_sigframe()
116 * programs that don't use SS_AUTODISARM get compatible. in get_sigframe()
119 sp = current->sas_ss_sp + current->sas_ss_size; in get_sigframe()
124 regs->ss != __USER_DS && in get_sigframe()
125 !(ka->sa.sa_flags & SA_RESTORER) && in get_sigframe()
126 ka->sa.sa_restorer) { in get_sigframe()
128 sp = (unsigned long) ka->sa.sa_restorer; in get_sigframe()
135 sp -= frame_size; in get_sigframe()
142 sp = ((sp + 4) & -FRAME_ALIGNMENT) - 4; in get_sigframe()
144 sp = round_down(sp, FRAME_ALIGNMENT) - 8; in get_sigframe()
148 * Return an always-bogus address instead so we will die with SIGSEGV. in get_sigframe()
155 current->comm, task_pid_nr(current)); in get_sigframe()
157 return (void __user *)-1L; in get_sigframe()
165 * Restore PKRU to the original, user-defined value; disable in get_sigframe()
169 return (void __user *)-1L; in get_sigframe()
178 * -- the largest size. It means the size for 64-bit apps is a bit more
188 * The FP state frame contains an XSAVE buffer which must be 64-byte aligned.
197 * -------------------------
199 * -------------------------
201 * -------------------------
203 * -------------------------
205 * -------------------------
207 * -------------------------
238 /* Perform fixup for the pre-signal frame. */ in setup_rt_frame()
243 if (ksig->ka.sa.sa_flags & SA_SIGINFO) in setup_rt_frame()
258 struct fpu *fpu = ¤t->thread.fpu; in handle_signal()
264 if (syscall_get_nr(current, regs) != -1) { in handle_signal()
267 case -ERESTART_RESTARTBLOCK: in handle_signal()
268 case -ERESTARTNOHAND: in handle_signal()
269 regs->ax = -EINTR; in handle_signal()
272 case -ERESTARTSYS: in handle_signal()
273 if (!(ksig->ka.sa.sa_flags & SA_RESTART)) { in handle_signal()
274 regs->ax = -EINTR; in handle_signal()
278 case -ERESTARTNOINTR: in handle_signal()
279 regs->ax = regs->orig_ax; in handle_signal()
280 regs->ip -= 2; in handle_signal()
306 regs->flags &= ~(X86_EFLAGS_DF|X86_EFLAGS_RF|X86_EFLAGS_TF); in handle_signal()
318 if (current->restart_block.arch_data & TS_COMPAT) in get_nr_restart_syscall()
322 return __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT); in get_nr_restart_syscall()
344 if (syscall_get_nr(current, regs) != -1) { in arch_do_signal_or_restart()
345 /* Restart the system call - no handlers present */ in arch_do_signal_or_restart()
347 case -ERESTARTNOHAND: in arch_do_signal_or_restart()
348 case -ERESTARTSYS: in arch_do_signal_or_restart()
349 case -ERESTARTNOINTR: in arch_do_signal_or_restart()
350 regs->ax = regs->orig_ax; in arch_do_signal_or_restart()
351 regs->ip -= 2; in arch_do_signal_or_restart()
354 case -ERESTART_RESTARTBLOCK: in arch_do_signal_or_restart()
355 regs->ax = get_nr_restart_syscall(regs); in arch_do_signal_or_restart()
356 regs->ip -= 2; in arch_do_signal_or_restart()
376 me->comm, me->pid, where, frame, in signal_fault()
377 regs->ip, regs->sp, regs->orig_ax); in signal_fault()
378 print_vma_addr(KERN_CONT " in ", regs->ip); in signal_fault()
400 * exceeds that size already. As such programs might never use the
409 * permission are checked against the size of the non-dynamic feature set
418 unsigned long fsize = max_frame_size - fpu_default_state_size; in sigaltstack_size_valid()
421 lockdep_assert_held(¤t->sighand->siglock); in sigaltstack_size_valid()
426 fsize += current->group_leader->thread.fpu.perm.__user_state_size; in sigaltstack_size_valid()
433 mask = current->group_leader->thread.fpu.perm.__state_perm; in sigaltstack_size_valid()