2 * Copyright (C) 1991, 1992 Linus Torvalds
3 * Copyright (C) 2000, 2001, 2002 Andi Kleen SuSE Labs
5 * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson
6 * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes
7 * 2000-2002 x86-64 support by Andi Kleen
9 #include <linux/sched.h>
11 #include <linux/smp.h>
12 #include <linux/kernel.h>
13 #include <linux/signal.h>
14 #include <linux/errno.h>
15 #include <linux/wait.h>
16 #include <linux/ptrace.h>
17 #include <linux/tracehook.h>
18 #include <linux/unistd.h>
19 #include <linux/stddef.h>
20 #include <linux/personality.h>
21 #include <linux/uaccess.h>
23 #include <asm/processor.h>
24 #include <asm/ucontext.h>
29 #include <asm/proto.h>
30 #include <asm/ia32_unistd.h>
32 #endif /* CONFIG_X86_64 */
34 #include <asm/syscall.h>
35 #include <asm/syscalls.h>
37 #include <asm/sigframe.h>
39 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
41 #define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \
42 X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \
43 X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \
47 # define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF)
49 # define FIX_EFLAGS __FIX_EFLAGS
52 #define COPY(x) do { \
53 get_user_ex(regs->x, &sc->x); \
56 #define GET_SEG(seg) ({ \
58 get_user_ex(tmp, &sc->seg); \
62 #define COPY_SEG(seg) do { \
63 regs->seg = GET_SEG(seg); \
66 #define COPY_SEG_CPL3(seg) do { \
67 regs->seg = GET_SEG(seg) | 3; \
71 restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
75 unsigned int tmpflags;
78 /* Always make any pending restarted system calls return -EINTR */
79 current_thread_info()->restart_block.fn = do_no_restart_syscall;
84 set_user_gs(regs, GET_SEG(gs));
88 #endif /* CONFIG_X86_32 */
90 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
91 COPY(dx); COPY(cx); COPY(ip);
102 #endif /* CONFIG_X86_64 */
107 #else /* !CONFIG_X86_32 */
108 /* Kernel saves and restores only the CS segment register on signals,
109 * which is the bare minimum needed to allow mixed 32/64-bit code.
110 * App's signal handler can save/restore other segments if needed. */
112 #endif /* CONFIG_X86_32 */
114 get_user_ex(tmpflags, &sc->flags);
115 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
116 regs->orig_ax = -1; /* disable syscall checks */
118 get_user_ex(buf, &sc->fpstate);
119 err |= restore_i387_xstate(buf);
121 get_user_ex(*pax, &sc->ax);
122 } get_user_catch(err);
128 setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate,
129 struct pt_regs *regs, unsigned long mask)
136 put_user_ex(get_user_gs(regs), (unsigned int __user *)&sc->gs);
137 put_user_ex(regs->fs, (unsigned int __user *)&sc->fs);
138 put_user_ex(regs->es, (unsigned int __user *)&sc->es);
139 put_user_ex(regs->ds, (unsigned int __user *)&sc->ds);
140 #endif /* CONFIG_X86_32 */
142 put_user_ex(regs->di, &sc->di);
143 put_user_ex(regs->si, &sc->si);
144 put_user_ex(regs->bp, &sc->bp);
145 put_user_ex(regs->sp, &sc->sp);
146 put_user_ex(regs->bx, &sc->bx);
147 put_user_ex(regs->dx, &sc->dx);
148 put_user_ex(regs->cx, &sc->cx);
149 put_user_ex(regs->ax, &sc->ax);
151 put_user_ex(regs->r8, &sc->r8);
152 put_user_ex(regs->r9, &sc->r9);
153 put_user_ex(regs->r10, &sc->r10);
154 put_user_ex(regs->r11, &sc->r11);
155 put_user_ex(regs->r12, &sc->r12);
156 put_user_ex(regs->r13, &sc->r13);
157 put_user_ex(regs->r14, &sc->r14);
158 put_user_ex(regs->r15, &sc->r15);
159 #endif /* CONFIG_X86_64 */
161 put_user_ex(current->thread.trap_no, &sc->trapno);
162 put_user_ex(current->thread.error_code, &sc->err);
163 put_user_ex(regs->ip, &sc->ip);
165 put_user_ex(regs->cs, (unsigned int __user *)&sc->cs);
166 put_user_ex(regs->flags, &sc->flags);
167 put_user_ex(regs->sp, &sc->sp_at_signal);
168 put_user_ex(regs->ss, (unsigned int __user *)&sc->ss);
169 #else /* !CONFIG_X86_32 */
170 put_user_ex(regs->flags, &sc->flags);
171 put_user_ex(regs->cs, &sc->cs);
172 put_user_ex(0, &sc->gs);
173 put_user_ex(0, &sc->fs);
174 #endif /* CONFIG_X86_32 */
176 put_user_ex(fpstate, &sc->fpstate);
178 /* non-iBCS2 extensions.. */
179 put_user_ex(mask, &sc->oldmask);
180 put_user_ex(current->thread.cr2, &sc->cr2);
181 } put_user_catch(err);
187 * Set up a signal frame.
191 * Determine which stack to use..
193 static unsigned long align_sigframe(unsigned long sp)
197 * Align the stack pointer according to the i386 ABI,
198 * i.e. so that on function entry ((sp + 4) & 15) == 0.
200 sp = ((sp + 4) & -16ul) - 4;
201 #else /* !CONFIG_X86_32 */
202 sp = round_down(sp, 16) - 8;
207 static inline void __user *
208 get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
209 void __user **fpstate)
211 /* Default to using normal stack */
212 unsigned long sp = regs->sp;
213 int onsigstack = on_sig_stack(sp);
218 #endif /* CONFIG_X86_64 */
221 /* This is the X/Open sanctioned signal stack switching. */
222 if (ka->sa.sa_flags & SA_ONSTACK) {
223 if (current->sas_ss_size)
224 sp = current->sas_ss_sp + current->sas_ss_size;
227 /* This is the legacy signal stack switching. */
228 if ((regs->ss & 0xffff) != __USER_DS &&
229 !(ka->sa.sa_flags & SA_RESTORER) &&
231 sp = (unsigned long) ka->sa.sa_restorer;
232 #endif /* CONFIG_X86_32 */
237 sp -= sig_xstate_size;
239 sp = round_down(sp, 64);
240 #endif /* CONFIG_X86_64 */
241 *fpstate = (void __user *)sp;
244 sp = align_sigframe(sp - frame_size);
247 * If we are on the alternate signal stack and would overflow it, don't.
248 * Return an always-bogus address instead so we will die with SIGSEGV.
250 if (onsigstack && !likely(on_sig_stack(sp)))
251 return (void __user *)-1L;
253 /* save i387 state */
254 if (used_math() && save_i387_xstate(*fpstate) < 0)
255 return (void __user *)-1L;
257 return (void __user *)sp;
261 static const struct {
265 } __attribute__((packed)) retcode = {
266 0xb858, /* popl %eax; movl $..., %eax */
268 0x80cd, /* int $0x80 */
271 static const struct {
276 } __attribute__((packed)) rt_retcode = {
277 0xb8, /* movl $..., %eax */
279 0x80cd, /* int $0x80 */
284 __setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
285 struct pt_regs *regs)
287 struct sigframe __user *frame;
288 void __user *restorer;
290 void __user *fpstate = NULL;
292 frame = get_sigframe(ka, regs, sizeof(*frame), &fpstate);
294 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
297 if (__put_user(sig, &frame->sig))
300 if (setup_sigcontext(&frame->sc, fpstate, regs, set->sig[0]))
303 if (_NSIG_WORDS > 1) {
304 if (__copy_to_user(&frame->extramask, &set->sig[1],
305 sizeof(frame->extramask)))
309 if (current->mm->context.vdso)
310 restorer = VDSO32_SYMBOL(current->mm->context.vdso, sigreturn);
312 restorer = &frame->retcode;
313 if (ka->sa.sa_flags & SA_RESTORER)
314 restorer = ka->sa.sa_restorer;
316 /* Set up to return from userspace. */
317 err |= __put_user(restorer, &frame->pretcode);
320 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80
322 * WE DO NOT USE IT ANY MORE! It's only left here for historical
323 * reasons and because gdb uses it as a signature to notice
324 * signal handler stack frames.
326 err |= __put_user(*((u64 *)&retcode), (u64 *)frame->retcode);
331 /* Set up registers for signal handler */
332 regs->sp = (unsigned long)frame;
333 regs->ip = (unsigned long)ka->sa.sa_handler;
334 regs->ax = (unsigned long)sig;
338 regs->ds = __USER_DS;
339 regs->es = __USER_DS;
340 regs->ss = __USER_DS;
341 regs->cs = __USER_CS;
346 static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
347 sigset_t *set, struct pt_regs *regs)
349 struct rt_sigframe __user *frame;
350 void __user *restorer;
352 void __user *fpstate = NULL;
354 frame = get_sigframe(ka, regs, sizeof(*frame), &fpstate);
356 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
360 put_user_ex(sig, &frame->sig);
361 put_user_ex(&frame->info, &frame->pinfo);
362 put_user_ex(&frame->uc, &frame->puc);
363 err |= copy_siginfo_to_user(&frame->info, info);
365 /* Create the ucontext. */
367 put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
369 put_user_ex(0, &frame->uc.uc_flags);
370 put_user_ex(0, &frame->uc.uc_link);
371 put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
372 put_user_ex(sas_ss_flags(regs->sp),
373 &frame->uc.uc_stack.ss_flags);
374 put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
375 err |= setup_sigcontext(&frame->uc.uc_mcontext, fpstate,
377 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
379 /* Set up to return from userspace. */
380 restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
381 if (ka->sa.sa_flags & SA_RESTORER)
382 restorer = ka->sa.sa_restorer;
383 put_user_ex(restorer, &frame->pretcode);
386 * This is movl $__NR_rt_sigreturn, %ax ; int $0x80
388 * WE DO NOT USE IT ANY MORE! It's only left here for historical
389 * reasons and because gdb uses it as a signature to notice
390 * signal handler stack frames.
392 put_user_ex(*((u64 *)&rt_retcode), (u64 *)frame->retcode);
393 } put_user_catch(err);
398 /* Set up registers for signal handler */
399 regs->sp = (unsigned long)frame;
400 regs->ip = (unsigned long)ka->sa.sa_handler;
401 regs->ax = (unsigned long)sig;
402 regs->dx = (unsigned long)&frame->info;
403 regs->cx = (unsigned long)&frame->uc;
405 regs->ds = __USER_DS;
406 regs->es = __USER_DS;
407 regs->ss = __USER_DS;
408 regs->cs = __USER_CS;
412 #else /* !CONFIG_X86_32 */
413 static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
414 sigset_t *set, struct pt_regs *regs)
416 struct rt_sigframe __user *frame;
417 void __user *fp = NULL;
419 struct task_struct *me = current;
421 frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp);
423 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
426 if (ka->sa.sa_flags & SA_SIGINFO) {
427 if (copy_siginfo_to_user(&frame->info, info))
432 /* Create the ucontext. */
434 put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
436 put_user_ex(0, &frame->uc.uc_flags);
437 put_user_ex(0, &frame->uc.uc_link);
438 put_user_ex(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
439 put_user_ex(sas_ss_flags(regs->sp),
440 &frame->uc.uc_stack.ss_flags);
441 put_user_ex(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
442 err |= setup_sigcontext(&frame->uc.uc_mcontext, fp, regs, set->sig[0]);
443 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
445 /* Set up to return from userspace. If provided, use a stub
446 already in userspace. */
447 /* x86-64 should always use SA_RESTORER. */
448 if (ka->sa.sa_flags & SA_RESTORER) {
449 put_user_ex(ka->sa.sa_restorer, &frame->pretcode);
451 /* could use a vstub here */
454 } put_user_catch(err);
459 /* Set up registers for signal handler */
461 /* In case the signal handler was declared without prototypes */
464 /* This also works for non SA_SIGINFO handlers because they expect the
465 next argument after the signal number on the stack. */
466 regs->si = (unsigned long)&frame->info;
467 regs->dx = (unsigned long)&frame->uc;
468 regs->ip = (unsigned long) ka->sa.sa_handler;
470 regs->sp = (unsigned long)frame;
472 /* Set up the CS register to run signal handlers in 64-bit mode,
473 even if the handler happens to be interrupting 32-bit code. */
474 regs->cs = __USER_CS;
478 #endif /* CONFIG_X86_32 */
482 * Atomically swap in the new signal mask, and wait for a signal.
485 sys_sigsuspend(int history0, int history1, old_sigset_t mask)
488 spin_lock_irq(¤t->sighand->siglock);
489 current->saved_sigmask = current->blocked;
490 siginitset(¤t->blocked, mask);
492 spin_unlock_irq(¤t->sighand->siglock);
494 current->state = TASK_INTERRUPTIBLE;
496 set_restore_sigmask();
498 return -ERESTARTNOHAND;
502 sys_sigaction(int sig, const struct old_sigaction __user *act,
503 struct old_sigaction __user *oact)
505 struct k_sigaction new_ka, old_ka;
511 if (!access_ok(VERIFY_READ, act, sizeof(*act)))
515 get_user_ex(new_ka.sa.sa_handler, &act->sa_handler);
516 get_user_ex(new_ka.sa.sa_flags, &act->sa_flags);
517 get_user_ex(mask, &act->sa_mask);
518 get_user_ex(new_ka.sa.sa_restorer, &act->sa_restorer);
519 } get_user_catch(ret);
523 siginitset(&new_ka.sa.sa_mask, mask);
526 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
529 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
533 put_user_ex(old_ka.sa.sa_handler, &oact->sa_handler);
534 put_user_ex(old_ka.sa.sa_flags, &oact->sa_flags);
535 put_user_ex(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
536 put_user_ex(old_ka.sa.sa_restorer, &oact->sa_restorer);
537 } put_user_catch(ret);
545 #endif /* CONFIG_X86_32 */
548 int sys_sigaltstack(struct pt_regs *regs)
550 const stack_t __user *uss = (const stack_t __user *)regs->bx;
551 stack_t __user *uoss = (stack_t __user *)regs->cx;
553 return do_sigaltstack(uss, uoss, regs->sp);
555 #else /* !CONFIG_X86_32 */
557 sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
558 struct pt_regs *regs)
560 return do_sigaltstack(uss, uoss, regs->sp);
562 #endif /* CONFIG_X86_32 */
565 * Do a signal return; undo the signal stack.
568 unsigned long sys_sigreturn(struct pt_regs *regs)
570 struct sigframe __user *frame;
574 frame = (struct sigframe __user *)(regs->sp - 8);
576 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
578 if (__get_user(set.sig[0], &frame->sc.oldmask) || (_NSIG_WORDS > 1
579 && __copy_from_user(&set.sig[1], &frame->extramask,
580 sizeof(frame->extramask))))
583 sigdelsetmask(&set, ~_BLOCKABLE);
584 spin_lock_irq(¤t->sighand->siglock);
585 current->blocked = set;
587 spin_unlock_irq(¤t->sighand->siglock);
589 if (restore_sigcontext(regs, &frame->sc, &ax))
594 signal_fault(regs, frame, "sigreturn");
598 #endif /* CONFIG_X86_32 */
600 long sys_rt_sigreturn(struct pt_regs *regs)
602 struct rt_sigframe __user *frame;
606 frame = (struct rt_sigframe __user *)(regs->sp - sizeof(long));
607 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
609 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
612 sigdelsetmask(&set, ~_BLOCKABLE);
613 spin_lock_irq(¤t->sighand->siglock);
614 current->blocked = set;
616 spin_unlock_irq(¤t->sighand->siglock);
618 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
621 if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT)
627 signal_fault(regs, frame, "rt_sigreturn");
632 * OK, we're invoking a handler:
634 static int signr_convert(int sig)
637 struct thread_info *info = current_thread_info();
639 if (info->exec_domain && info->exec_domain->signal_invmap && sig < 32)
640 return info->exec_domain->signal_invmap[sig];
641 #endif /* CONFIG_X86_32 */
648 #define ia32_setup_frame __setup_frame
649 #define ia32_setup_rt_frame __setup_rt_frame
651 #else /* !CONFIG_X86_32 */
653 #ifdef CONFIG_IA32_EMULATION
654 #define is_ia32 test_thread_flag(TIF_IA32)
655 #else /* !CONFIG_IA32_EMULATION */
657 #endif /* CONFIG_IA32_EMULATION */
659 int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
660 sigset_t *set, struct pt_regs *regs);
661 int ia32_setup_frame(int sig, struct k_sigaction *ka,
662 sigset_t *set, struct pt_regs *regs);
664 #endif /* CONFIG_X86_32 */
667 setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
668 sigset_t *set, struct pt_regs *regs)
670 int usig = signr_convert(sig);
673 /* Set up the stack frame */
675 if (ka->sa.sa_flags & SA_SIGINFO)
676 ret = ia32_setup_rt_frame(usig, ka, info, set, regs);
678 ret = ia32_setup_frame(usig, ka, set, regs);
680 ret = __setup_rt_frame(sig, ka, info, set, regs);
683 force_sigsegv(sig, current);
691 handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
692 sigset_t *oldset, struct pt_regs *regs)
696 /* Are we from a system call? */
697 if (syscall_get_nr(current, regs) >= 0) {
698 /* If so, check system call restarting.. */
699 switch (syscall_get_error(current, regs)) {
700 case -ERESTART_RESTARTBLOCK:
701 case -ERESTARTNOHAND:
706 if (!(ka->sa.sa_flags & SA_RESTART)) {
711 case -ERESTARTNOINTR:
712 regs->ax = regs->orig_ax;
719 * If TF is set due to a debugger (TIF_FORCED_TF), clear the TF
720 * flag so that register information in the sigcontext is correct.
722 if (unlikely(regs->flags & X86_EFLAGS_TF) &&
723 likely(test_and_clear_thread_flag(TIF_FORCED_TF)))
724 regs->flags &= ~X86_EFLAGS_TF;
726 ret = setup_rt_frame(sig, ka, info, oldset, regs);
733 * This has nothing to do with segment registers,
734 * despite the name. This magic affects uaccess.h
735 * macros' behavior. Reset it to the normal setting.
741 * Clear the direction flag as per the ABI for function entry.
743 regs->flags &= ~X86_EFLAGS_DF;
746 * Clear TF when entering the signal handler, but
747 * notify any tracer that was single-stepping it.
748 * The tracer may want to single-step inside the
751 regs->flags &= ~X86_EFLAGS_TF;
753 spin_lock_irq(¤t->sighand->siglock);
754 sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask);
755 if (!(ka->sa.sa_flags & SA_NODEFER))
756 sigaddset(¤t->blocked, sig);
758 spin_unlock_irq(¤t->sighand->siglock);
760 tracehook_signal_handler(sig, info, ka, regs,
761 test_thread_flag(TIF_SINGLESTEP));
767 #define NR_restart_syscall __NR_restart_syscall
768 #else /* !CONFIG_X86_32 */
769 #define NR_restart_syscall \
770 test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : __NR_restart_syscall
771 #endif /* CONFIG_X86_32 */
774 * Note that 'init' is a special process: it doesn't get signals it doesn't
775 * want to handle. Thus you cannot kill init even with a SIGKILL even by
778 static void do_signal(struct pt_regs *regs)
780 struct k_sigaction ka;
786 * We want the common case to go fast, which is why we may in certain
787 * cases get here from kernel mode. Just return without doing anything
789 * X86_32: vm86 regs switched out by assembly code before reaching
790 * here, so testing against kernel CS suffices.
792 if (!user_mode(regs))
795 if (current_thread_info()->status & TS_RESTORE_SIGMASK)
796 oldset = ¤t->saved_sigmask;
798 oldset = ¤t->blocked;
800 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
803 * Re-enable any watchpoints before delivering the
804 * signal to user space. The processor register will
805 * have been cleared if the watchpoint triggered
808 if (current->thread.debugreg7)
809 set_debugreg(current->thread.debugreg7, 7);
811 /* Whee! Actually deliver the signal. */
812 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
814 * A signal was successfully delivered; the saved
815 * sigmask will have been stored in the signal frame,
816 * and will be restored by sigreturn, so we can simply
817 * clear the TS_RESTORE_SIGMASK flag.
819 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
824 /* Did we come from a system call? */
825 if (syscall_get_nr(current, regs) >= 0) {
826 /* Restart the system call - no handlers present */
827 switch (syscall_get_error(current, regs)) {
828 case -ERESTARTNOHAND:
830 case -ERESTARTNOINTR:
831 regs->ax = regs->orig_ax;
835 case -ERESTART_RESTARTBLOCK:
836 regs->ax = NR_restart_syscall;
843 * If there's no signal to deliver, we just put the saved sigmask
846 if (current_thread_info()->status & TS_RESTORE_SIGMASK) {
847 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
848 sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL);
853 * notification of userspace execution resumption
854 * - triggered by the TIF_WORK_MASK flags
857 do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
859 #if defined(CONFIG_X86_64) && defined(CONFIG_X86_MCE)
860 /* notify userspace of pending MCEs */
861 if (thread_info_flags & _TIF_MCE_NOTIFY)
863 #endif /* CONFIG_X86_64 && CONFIG_X86_MCE */
865 /* deal with pending signal delivery */
866 if (thread_info_flags & _TIF_SIGPENDING)
869 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
870 clear_thread_flag(TIF_NOTIFY_RESUME);
871 tracehook_notify_resume(regs);
875 clear_thread_flag(TIF_IRET);
876 #endif /* CONFIG_X86_32 */
879 void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
881 struct task_struct *me = current;
883 if (show_unhandled_signals && printk_ratelimit()) {
885 "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx",
886 task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG,
887 me->comm, me->pid, where, frame,
888 regs->ip, regs->sp, regs->orig_ax);
889 print_vma_addr(" in ", regs->ip);
890 printk(KERN_CONT "\n");
893 force_sig(SIGSEGV, me);