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
10 #include <linux/sched.h>
12 #include <linux/smp.h>
13 #include <linux/kernel.h>
14 #include <linux/signal.h>
15 #include <linux/errno.h>
16 #include <linux/wait.h>
17 #include <linux/ptrace.h>
18 #include <linux/tracehook.h>
19 #include <linux/unistd.h>
20 #include <linux/stddef.h>
21 #include <linux/personality.h>
22 #include <linux/uaccess.h>
24 #include <asm/processor.h>
25 #include <asm/ucontext.h>
30 #include <asm/proto.h>
31 #include <asm/ia32_unistd.h>
33 #endif /* CONFIG_X86_64 */
35 #include <asm/syscall.h>
36 #include <asm/syscalls.h>
38 #include <asm/sigframe.h>
40 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
42 #define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \
43 X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \
44 X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \
48 # define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF)
50 # define FIX_EFLAGS __FIX_EFLAGS
53 #define COPY(x) do { \
54 get_user_ex(regs->x, &sc->x); \
57 #define GET_SEG(seg) ({ \
59 get_user_ex(tmp, &sc->seg); \
63 #define COPY_SEG(seg) do { \
64 regs->seg = GET_SEG(seg); \
67 #define COPY_SEG_CPL3(seg) do { \
68 regs->seg = GET_SEG(seg) | 3; \
72 restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
76 unsigned int tmpflags;
79 /* Always make any pending restarted system calls return -EINTR */
80 current_thread_info()->restart_block.fn = do_no_restart_syscall;
85 set_user_gs(regs, GET_SEG(gs));
89 #endif /* CONFIG_X86_32 */
91 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
92 COPY(dx); COPY(cx); COPY(ip);
103 #endif /* CONFIG_X86_64 */
108 #else /* !CONFIG_X86_32 */
109 /* Kernel saves and restores only the CS segment register on signals,
110 * which is the bare minimum needed to allow mixed 32/64-bit code.
111 * App's signal handler can save/restore other segments if needed. */
113 #endif /* CONFIG_X86_32 */
115 get_user_ex(tmpflags, &sc->flags);
116 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
117 regs->orig_ax = -1; /* disable syscall checks */
119 get_user_ex(buf, &sc->fpstate);
120 err |= restore_i387_xstate(buf);
122 get_user_ex(*pax, &sc->ax);
123 } get_user_catch(err);
129 setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate,
130 struct pt_regs *regs, unsigned long mask)
137 put_user_ex(get_user_gs(regs), (unsigned int __user *)&sc->gs);
138 put_user_ex(regs->fs, (unsigned int __user *)&sc->fs);
139 put_user_ex(regs->es, (unsigned int __user *)&sc->es);
140 put_user_ex(regs->ds, (unsigned int __user *)&sc->ds);
141 #endif /* CONFIG_X86_32 */
143 put_user_ex(regs->di, &sc->di);
144 put_user_ex(regs->si, &sc->si);
145 put_user_ex(regs->bp, &sc->bp);
146 put_user_ex(regs->sp, &sc->sp);
147 put_user_ex(regs->bx, &sc->bx);
148 put_user_ex(regs->dx, &sc->dx);
149 put_user_ex(regs->cx, &sc->cx);
150 put_user_ex(regs->ax, &sc->ax);
152 put_user_ex(regs->r8, &sc->r8);
153 put_user_ex(regs->r9, &sc->r9);
154 put_user_ex(regs->r10, &sc->r10);
155 put_user_ex(regs->r11, &sc->r11);
156 put_user_ex(regs->r12, &sc->r12);
157 put_user_ex(regs->r13, &sc->r13);
158 put_user_ex(regs->r14, &sc->r14);
159 put_user_ex(regs->r15, &sc->r15);
160 #endif /* CONFIG_X86_64 */
162 put_user_ex(current->thread.trap_no, &sc->trapno);
163 put_user_ex(current->thread.error_code, &sc->err);
164 put_user_ex(regs->ip, &sc->ip);
166 put_user_ex(regs->cs, (unsigned int __user *)&sc->cs);
167 put_user_ex(regs->flags, &sc->flags);
168 put_user_ex(regs->sp, &sc->sp_at_signal);
169 put_user_ex(regs->ss, (unsigned int __user *)&sc->ss);
170 #else /* !CONFIG_X86_32 */
171 put_user_ex(regs->flags, &sc->flags);
172 put_user_ex(regs->cs, &sc->cs);
173 put_user_ex(0, &sc->gs);
174 put_user_ex(0, &sc->fs);
175 #endif /* CONFIG_X86_32 */
177 put_user_ex(fpstate, &sc->fpstate);
179 /* non-iBCS2 extensions.. */
180 put_user_ex(mask, &sc->oldmask);
181 put_user_ex(current->thread.cr2, &sc->cr2);
182 } put_user_catch(err);
188 * Set up a signal frame.
192 * Determine which stack to use..
194 static unsigned long align_sigframe(unsigned long sp)
198 * Align the stack pointer according to the i386 ABI,
199 * i.e. so that on function entry ((sp + 4) & 15) == 0.
201 sp = ((sp + 4) & -16ul) - 4;
202 #else /* !CONFIG_X86_32 */
203 sp = round_down(sp, 16) - 8;
208 static inline void __user *
209 get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
210 void __user **fpstate)
212 /* Default to using normal stack */
213 unsigned long sp = regs->sp;
218 #endif /* CONFIG_X86_64 */
221 * If we are on the alternate signal stack and would overflow it, don't.
222 * Return an always-bogus address instead so we will die with SIGSEGV.
224 if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
225 return (void __user *) -1L;
227 /* This is the X/Open sanctioned signal stack switching. */
228 if (ka->sa.sa_flags & SA_ONSTACK) {
229 if (sas_ss_flags(sp) == 0)
230 sp = current->sas_ss_sp + current->sas_ss_size;
233 /* This is the legacy signal stack switching. */
234 if ((regs->ss & 0xffff) != __USER_DS &&
235 !(ka->sa.sa_flags & SA_RESTORER) &&
237 sp = (unsigned long) ka->sa.sa_restorer;
238 #endif /* CONFIG_X86_32 */
242 sp -= sig_xstate_size;
244 sp = round_down(sp, 64);
245 #endif /* CONFIG_X86_64 */
246 *fpstate = (void __user *)sp;
248 if (save_i387_xstate(*fpstate) < 0)
249 return (void __user *)-1L;
252 return (void __user *)align_sigframe(sp - frame_size);
256 static const struct {
260 } __attribute__((packed)) retcode = {
261 0xb858, /* popl %eax; movl $..., %eax */
263 0x80cd, /* int $0x80 */
266 static const struct {
271 } __attribute__((packed)) rt_retcode = {
272 0xb8, /* movl $..., %eax */
274 0x80cd, /* int $0x80 */
279 __setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
280 struct pt_regs *regs)
282 struct sigframe __user *frame;
283 void __user *restorer;
285 void __user *fpstate = NULL;
287 frame = get_sigframe(ka, regs, sizeof(*frame), &fpstate);
289 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
292 if (__put_user(sig, &frame->sig))
295 if (setup_sigcontext(&frame->sc, fpstate, regs, set->sig[0]))
298 if (_NSIG_WORDS > 1) {
299 if (__copy_to_user(&frame->extramask, &set->sig[1],
300 sizeof(frame->extramask)))
304 if (current->mm->context.vdso)
305 restorer = VDSO32_SYMBOL(current->mm->context.vdso, sigreturn);
307 restorer = &frame->retcode;
308 if (ka->sa.sa_flags & SA_RESTORER)
309 restorer = ka->sa.sa_restorer;
311 /* Set up to return from userspace. */
312 err |= __put_user(restorer, &frame->pretcode);
315 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80
317 * WE DO NOT USE IT ANY MORE! It's only left here for historical
318 * reasons and because gdb uses it as a signature to notice
319 * signal handler stack frames.
321 err |= __put_user(*((u64 *)&retcode), (u64 *)frame->retcode);
326 /* Set up registers for signal handler */
327 regs->sp = (unsigned long)frame;
328 regs->ip = (unsigned long)ka->sa.sa_handler;
329 regs->ax = (unsigned long)sig;
333 regs->ds = __USER_DS;
334 regs->es = __USER_DS;
335 regs->ss = __USER_DS;
336 regs->cs = __USER_CS;
341 static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
342 sigset_t *set, struct pt_regs *regs)
344 struct rt_sigframe __user *frame;
345 void __user *restorer;
347 void __user *fpstate = NULL;
349 frame = get_sigframe(ka, regs, sizeof(*frame), &fpstate);
351 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
355 put_user_ex(sig, &frame->sig);
356 put_user_ex(&frame->info, &frame->pinfo);
357 put_user_ex(&frame->uc, &frame->puc);
358 err |= copy_siginfo_to_user(&frame->info, info);
360 /* Create the ucontext. */
362 put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
364 put_user_ex(0, &frame->uc.uc_flags);
365 put_user_ex(0, &frame->uc.uc_link);
366 put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
367 put_user_ex(sas_ss_flags(regs->sp),
368 &frame->uc.uc_stack.ss_flags);
369 put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
370 err |= setup_sigcontext(&frame->uc.uc_mcontext, fpstate,
372 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
374 /* Set up to return from userspace. */
375 restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
376 if (ka->sa.sa_flags & SA_RESTORER)
377 restorer = ka->sa.sa_restorer;
378 put_user_ex(restorer, &frame->pretcode);
381 * This is movl $__NR_rt_sigreturn, %ax ; int $0x80
383 * WE DO NOT USE IT ANY MORE! It's only left here for historical
384 * reasons and because gdb uses it as a signature to notice
385 * signal handler stack frames.
387 put_user_ex(*((u64 *)&rt_retcode), (u64 *)frame->retcode);
388 } put_user_catch(err);
393 /* Set up registers for signal handler */
394 regs->sp = (unsigned long)frame;
395 regs->ip = (unsigned long)ka->sa.sa_handler;
396 regs->ax = (unsigned long)sig;
397 regs->dx = (unsigned long)&frame->info;
398 regs->cx = (unsigned long)&frame->uc;
400 regs->ds = __USER_DS;
401 regs->es = __USER_DS;
402 regs->ss = __USER_DS;
403 regs->cs = __USER_CS;
407 #else /* !CONFIG_X86_32 */
408 static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
409 sigset_t *set, struct pt_regs *regs)
411 struct rt_sigframe __user *frame;
412 void __user *fp = NULL;
414 struct task_struct *me = current;
416 frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp);
418 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
421 if (ka->sa.sa_flags & SA_SIGINFO) {
422 if (copy_siginfo_to_user(&frame->info, info))
427 /* Create the ucontext. */
429 put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
431 put_user_ex(0, &frame->uc.uc_flags);
432 put_user_ex(0, &frame->uc.uc_link);
433 put_user_ex(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
434 put_user_ex(sas_ss_flags(regs->sp),
435 &frame->uc.uc_stack.ss_flags);
436 put_user_ex(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
437 err |= setup_sigcontext(&frame->uc.uc_mcontext, fp, regs, set->sig[0]);
438 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
440 /* Set up to return from userspace. If provided, use a stub
441 already in userspace. */
442 /* x86-64 should always use SA_RESTORER. */
443 if (ka->sa.sa_flags & SA_RESTORER) {
444 put_user_ex(ka->sa.sa_restorer, &frame->pretcode);
446 /* could use a vstub here */
449 } put_user_catch(err);
454 /* Set up registers for signal handler */
456 /* In case the signal handler was declared without prototypes */
459 /* This also works for non SA_SIGINFO handlers because they expect the
460 next argument after the signal number on the stack. */
461 regs->si = (unsigned long)&frame->info;
462 regs->dx = (unsigned long)&frame->uc;
463 regs->ip = (unsigned long) ka->sa.sa_handler;
465 regs->sp = (unsigned long)frame;
467 /* Set up the CS register to run signal handlers in 64-bit mode,
468 even if the handler happens to be interrupting 32-bit code. */
469 regs->cs = __USER_CS;
473 #endif /* CONFIG_X86_32 */
477 * Atomically swap in the new signal mask, and wait for a signal.
480 sys_sigsuspend(int history0, int history1, old_sigset_t mask)
483 spin_lock_irq(¤t->sighand->siglock);
484 current->saved_sigmask = current->blocked;
485 siginitset(¤t->blocked, mask);
487 spin_unlock_irq(¤t->sighand->siglock);
489 current->state = TASK_INTERRUPTIBLE;
491 set_restore_sigmask();
493 return -ERESTARTNOHAND;
497 sys_sigaction(int sig, const struct old_sigaction __user *act,
498 struct old_sigaction __user *oact)
500 struct k_sigaction new_ka, old_ka;
506 if (!access_ok(VERIFY_READ, act, sizeof(*act)))
510 get_user_ex(new_ka.sa.sa_handler, &act->sa_handler);
511 get_user_ex(new_ka.sa.sa_flags, &act->sa_flags);
512 get_user_ex(mask, &act->sa_mask);
513 get_user_ex(new_ka.sa.sa_restorer, &act->sa_restorer);
514 } get_user_catch(ret);
518 siginitset(&new_ka.sa.sa_mask, mask);
521 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
524 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
528 put_user_ex(old_ka.sa.sa_handler, &oact->sa_handler);
529 put_user_ex(old_ka.sa.sa_flags, &oact->sa_flags);
530 put_user_ex(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
531 put_user_ex(old_ka.sa.sa_restorer, &oact->sa_restorer);
532 } put_user_catch(ret);
540 #endif /* CONFIG_X86_32 */
543 int sys_sigaltstack(struct pt_regs *regs)
545 const stack_t __user *uss = (const stack_t __user *)regs->bx;
546 stack_t __user *uoss = (stack_t __user *)regs->cx;
548 return do_sigaltstack(uss, uoss, regs->sp);
550 #else /* !CONFIG_X86_32 */
552 sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
553 struct pt_regs *regs)
555 return do_sigaltstack(uss, uoss, regs->sp);
557 #endif /* CONFIG_X86_32 */
560 * Do a signal return; undo the signal stack.
563 unsigned long sys_sigreturn(struct pt_regs *regs)
565 struct sigframe __user *frame;
569 frame = (struct sigframe __user *)(regs->sp - 8);
571 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
573 if (__get_user(set.sig[0], &frame->sc.oldmask) || (_NSIG_WORDS > 1
574 && __copy_from_user(&set.sig[1], &frame->extramask,
575 sizeof(frame->extramask))))
578 sigdelsetmask(&set, ~_BLOCKABLE);
579 spin_lock_irq(¤t->sighand->siglock);
580 current->blocked = set;
582 spin_unlock_irq(¤t->sighand->siglock);
584 if (restore_sigcontext(regs, &frame->sc, &ax))
589 signal_fault(regs, frame, "sigreturn");
593 #endif /* CONFIG_X86_32 */
595 long sys_rt_sigreturn(struct pt_regs *regs)
597 struct rt_sigframe __user *frame;
601 frame = (struct rt_sigframe __user *)(regs->sp - sizeof(long));
602 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
604 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
607 sigdelsetmask(&set, ~_BLOCKABLE);
608 spin_lock_irq(¤t->sighand->siglock);
609 current->blocked = set;
611 spin_unlock_irq(¤t->sighand->siglock);
613 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
616 if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT)
622 signal_fault(regs, frame, "rt_sigreturn");
627 * OK, we're invoking a handler:
629 static int signr_convert(int sig)
632 struct thread_info *info = current_thread_info();
634 if (info->exec_domain && info->exec_domain->signal_invmap && sig < 32)
635 return info->exec_domain->signal_invmap[sig];
636 #endif /* CONFIG_X86_32 */
643 #define ia32_setup_frame __setup_frame
644 #define ia32_setup_rt_frame __setup_rt_frame
646 #else /* !CONFIG_X86_32 */
648 #ifdef CONFIG_IA32_EMULATION
649 #define is_ia32 test_thread_flag(TIF_IA32)
650 #else /* !CONFIG_IA32_EMULATION */
652 #endif /* CONFIG_IA32_EMULATION */
654 int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
655 sigset_t *set, struct pt_regs *regs);
656 int ia32_setup_frame(int sig, struct k_sigaction *ka,
657 sigset_t *set, struct pt_regs *regs);
659 #endif /* CONFIG_X86_32 */
662 setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
663 sigset_t *set, struct pt_regs *regs)
665 int usig = signr_convert(sig);
668 /* Set up the stack frame */
670 if (ka->sa.sa_flags & SA_SIGINFO)
671 ret = ia32_setup_rt_frame(usig, ka, info, set, regs);
673 ret = ia32_setup_frame(usig, ka, set, regs);
675 ret = __setup_rt_frame(sig, ka, info, set, regs);
678 force_sigsegv(sig, current);
686 handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
687 sigset_t *oldset, struct pt_regs *regs)
691 /* Are we from a system call? */
692 if (syscall_get_nr(current, regs) >= 0) {
693 /* If so, check system call restarting.. */
694 switch (syscall_get_error(current, regs)) {
695 case -ERESTART_RESTARTBLOCK:
696 case -ERESTARTNOHAND:
701 if (!(ka->sa.sa_flags & SA_RESTART)) {
706 case -ERESTARTNOINTR:
707 regs->ax = regs->orig_ax;
714 * If TF is set due to a debugger (TIF_FORCED_TF), clear the TF
715 * flag so that register information in the sigcontext is correct.
717 if (unlikely(regs->flags & X86_EFLAGS_TF) &&
718 likely(test_and_clear_thread_flag(TIF_FORCED_TF)))
719 regs->flags &= ~X86_EFLAGS_TF;
721 ret = setup_rt_frame(sig, ka, info, oldset, regs);
728 * This has nothing to do with segment registers,
729 * despite the name. This magic affects uaccess.h
730 * macros' behavior. Reset it to the normal setting.
736 * Clear the direction flag as per the ABI for function entry.
738 regs->flags &= ~X86_EFLAGS_DF;
741 * Clear TF when entering the signal handler, but
742 * notify any tracer that was single-stepping it.
743 * The tracer may want to single-step inside the
746 regs->flags &= ~X86_EFLAGS_TF;
748 spin_lock_irq(¤t->sighand->siglock);
749 sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask);
750 if (!(ka->sa.sa_flags & SA_NODEFER))
751 sigaddset(¤t->blocked, sig);
753 spin_unlock_irq(¤t->sighand->siglock);
755 tracehook_signal_handler(sig, info, ka, regs,
756 test_thread_flag(TIF_SINGLESTEP));
762 #define NR_restart_syscall __NR_restart_syscall
763 #else /* !CONFIG_X86_32 */
764 #define NR_restart_syscall \
765 test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : __NR_restart_syscall
766 #endif /* CONFIG_X86_32 */
769 * Note that 'init' is a special process: it doesn't get signals it doesn't
770 * want to handle. Thus you cannot kill init even with a SIGKILL even by
773 static void do_signal(struct pt_regs *regs)
775 struct k_sigaction ka;
781 * We want the common case to go fast, which is why we may in certain
782 * cases get here from kernel mode. Just return without doing anything
784 * X86_32: vm86 regs switched out by assembly code before reaching
785 * here, so testing against kernel CS suffices.
787 if (!user_mode(regs))
790 if (current_thread_info()->status & TS_RESTORE_SIGMASK)
791 oldset = ¤t->saved_sigmask;
793 oldset = ¤t->blocked;
795 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
798 * Re-enable any watchpoints before delivering the
799 * signal to user space. The processor register will
800 * have been cleared if the watchpoint triggered
803 if (current->thread.debugreg7)
804 set_debugreg(current->thread.debugreg7, 7);
806 /* Whee! Actually deliver the signal. */
807 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
809 * A signal was successfully delivered; the saved
810 * sigmask will have been stored in the signal frame,
811 * and will be restored by sigreturn, so we can simply
812 * clear the TS_RESTORE_SIGMASK flag.
814 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
819 /* Did we come from a system call? */
820 if (syscall_get_nr(current, regs) >= 0) {
821 /* Restart the system call - no handlers present */
822 switch (syscall_get_error(current, regs)) {
823 case -ERESTARTNOHAND:
825 case -ERESTARTNOINTR:
826 regs->ax = regs->orig_ax;
830 case -ERESTART_RESTARTBLOCK:
831 regs->ax = NR_restart_syscall;
838 * If there's no signal to deliver, we just put the saved sigmask
841 if (current_thread_info()->status & TS_RESTORE_SIGMASK) {
842 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
843 sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL);
848 * notification of userspace execution resumption
849 * - triggered by the TIF_WORK_MASK flags
852 do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
854 #if defined(CONFIG_X86_64) && defined(CONFIG_X86_MCE)
855 /* notify userspace of pending MCEs */
856 if (thread_info_flags & _TIF_MCE_NOTIFY)
858 #endif /* CONFIG_X86_64 && CONFIG_X86_MCE */
860 /* deal with pending signal delivery */
861 if (thread_info_flags & _TIF_SIGPENDING)
864 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
865 clear_thread_flag(TIF_NOTIFY_RESUME);
866 tracehook_notify_resume(regs);
870 clear_thread_flag(TIF_IRET);
871 #endif /* CONFIG_X86_32 */
874 void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
876 struct task_struct *me = current;
878 if (show_unhandled_signals && printk_ratelimit()) {
880 "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx",
881 task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG,
882 me->comm, me->pid, where, frame,
883 regs->ip, regs->sp, regs->orig_ax);
884 print_vma_addr(" in ", regs->ip);
885 printk(KERN_CONT "\n");
888 force_sig(SIGSEGV, me);