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>
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
54 err |= __get_user(regs->x, &sc->x); \
57 #define COPY_SEG_CPL3(seg) { \
59 err |= __get_user(tmp, &sc->seg); \
60 regs->seg = tmp | 3; \
64 restore_sigcontext(struct pt_regs
*regs
, struct sigcontext __user
*sc
,
68 unsigned int tmpflags
;
71 /* Always make any pending restarted system calls return -EINTR */
72 current_thread_info()->restart_block
.fn
= do_no_restart_syscall
;
79 #endif /* CONFIG_X86_32 */
81 COPY(di
); COPY(si
); COPY(bp
); COPY(sp
); COPY(bx
);
82 COPY(dx
); COPY(cx
); COPY(ip
);
93 #endif /* CONFIG_X86_64 */
98 #else /* !CONFIG_X86_32 */
99 /* Kernel saves and restores only the CS segment register on signals,
100 * which is the bare minimum needed to allow mixed 32/64-bit code.
101 * App's signal handler can save/restore other segments if needed. */
103 #endif /* CONFIG_X86_32 */
105 err
|= __get_user(tmpflags
, &sc
->flags
);
106 regs
->flags
= (regs
->flags
& ~FIX_EFLAGS
) | (tmpflags
& FIX_EFLAGS
);
107 regs
->orig_ax
= -1; /* disable syscall checks */
109 err
|= __get_user(buf
, &sc
->fpstate
);
110 err
|= restore_i387_xstate(buf
);
112 err
|= __get_user(*pax
, &sc
->ax
);
117 setup_sigcontext(struct sigcontext __user
*sc
, void __user
*fpstate
,
118 struct pt_regs
*regs
, unsigned long mask
)
126 savesegment(gs
, tmp
);
127 err
|= __put_user(tmp
, (unsigned int __user
*)&sc
->gs
);
129 err
|= __put_user(regs
->fs
, (unsigned int __user
*)&sc
->fs
);
130 err
|= __put_user(regs
->es
, (unsigned int __user
*)&sc
->es
);
131 err
|= __put_user(regs
->ds
, (unsigned int __user
*)&sc
->ds
);
132 #endif /* CONFIG_X86_32 */
134 err
|= __put_user(regs
->di
, &sc
->di
);
135 err
|= __put_user(regs
->si
, &sc
->si
);
136 err
|= __put_user(regs
->bp
, &sc
->bp
);
137 err
|= __put_user(regs
->sp
, &sc
->sp
);
138 err
|= __put_user(regs
->bx
, &sc
->bx
);
139 err
|= __put_user(regs
->dx
, &sc
->dx
);
140 err
|= __put_user(regs
->cx
, &sc
->cx
);
141 err
|= __put_user(regs
->ax
, &sc
->ax
);
143 err
|= __put_user(regs
->r8
, &sc
->r8
);
144 err
|= __put_user(regs
->r9
, &sc
->r9
);
145 err
|= __put_user(regs
->r10
, &sc
->r10
);
146 err
|= __put_user(regs
->r11
, &sc
->r11
);
147 err
|= __put_user(regs
->r12
, &sc
->r12
);
148 err
|= __put_user(regs
->r13
, &sc
->r13
);
149 err
|= __put_user(regs
->r14
, &sc
->r14
);
150 err
|= __put_user(regs
->r15
, &sc
->r15
);
151 #endif /* CONFIG_X86_64 */
153 err
|= __put_user(current
->thread
.trap_no
, &sc
->trapno
);
154 err
|= __put_user(current
->thread
.error_code
, &sc
->err
);
155 err
|= __put_user(regs
->ip
, &sc
->ip
);
157 err
|= __put_user(regs
->cs
, (unsigned int __user
*)&sc
->cs
);
158 err
|= __put_user(regs
->flags
, &sc
->flags
);
159 err
|= __put_user(regs
->sp
, &sc
->sp_at_signal
);
160 err
|= __put_user(regs
->ss
, (unsigned int __user
*)&sc
->ss
);
161 #else /* !CONFIG_X86_32 */
162 err
|= __put_user(regs
->flags
, &sc
->flags
);
163 err
|= __put_user(regs
->cs
, &sc
->cs
);
164 err
|= __put_user(0, &sc
->gs
);
165 err
|= __put_user(0, &sc
->fs
);
166 #endif /* CONFIG_X86_32 */
168 err
|= __put_user(fpstate
, &sc
->fpstate
);
170 /* non-iBCS2 extensions.. */
171 err
|= __put_user(mask
, &sc
->oldmask
);
172 err
|= __put_user(current
->thread
.cr2
, &sc
->cr2
);
178 * Set up a signal frame.
181 static const struct {
185 } __attribute__((packed
)) retcode
= {
186 0xb858, /* popl %eax; movl $..., %eax */
188 0x80cd, /* int $0x80 */
191 static const struct {
196 } __attribute__((packed
)) rt_retcode
= {
197 0xb8, /* movl $..., %eax */
199 0x80cd, /* int $0x80 */
204 * Determine which stack to use..
206 static inline void __user
*
207 get_sigframe(struct k_sigaction
*ka
, struct pt_regs
*regs
, size_t frame_size
,
212 /* Default to using normal stack */
216 * If we are on the alternate signal stack and would overflow it, don't.
217 * Return an always-bogus address instead so we will die with SIGSEGV.
219 if (on_sig_stack(sp
) && !likely(on_sig_stack(sp
- frame_size
)))
220 return (void __user
*) -1L;
222 /* This is the X/Open sanctioned signal stack switching. */
223 if (ka
->sa
.sa_flags
& SA_ONSTACK
) {
224 if (sas_ss_flags(sp
) == 0)
225 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
;
235 sp
= sp
- sig_xstate_size
;
236 *fpstate
= (struct _fpstate
*) sp
;
237 if (save_i387_xstate(*fpstate
) < 0)
238 return (void __user
*)-1L;
243 * Align the stack pointer according to the i386 ABI,
244 * i.e. so that on function entry ((sp + 4) & 15) == 0.
246 sp
= ((sp
+ 4) & -16ul) - 4;
248 return (void __user
*) sp
;
252 __setup_frame(int sig
, struct k_sigaction
*ka
, sigset_t
*set
,
253 struct pt_regs
*regs
)
255 struct sigframe __user
*frame
;
256 void __user
*restorer
;
258 void __user
*fpstate
= NULL
;
260 frame
= get_sigframe(ka
, regs
, sizeof(*frame
), &fpstate
);
262 if (!access_ok(VERIFY_WRITE
, frame
, sizeof(*frame
)))
265 if (__put_user(sig
, &frame
->sig
))
268 if (setup_sigcontext(&frame
->sc
, fpstate
, regs
, set
->sig
[0]))
271 if (_NSIG_WORDS
> 1) {
272 if (__copy_to_user(&frame
->extramask
, &set
->sig
[1],
273 sizeof(frame
->extramask
)))
277 if (current
->mm
->context
.vdso
)
278 restorer
= VDSO32_SYMBOL(current
->mm
->context
.vdso
, sigreturn
);
280 restorer
= &frame
->retcode
;
281 if (ka
->sa
.sa_flags
& SA_RESTORER
)
282 restorer
= ka
->sa
.sa_restorer
;
284 /* Set up to return from userspace. */
285 err
|= __put_user(restorer
, &frame
->pretcode
);
288 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80
290 * WE DO NOT USE IT ANY MORE! It's only left here for historical
291 * reasons and because gdb uses it as a signature to notice
292 * signal handler stack frames.
294 err
|= __put_user(*((u64
*)&retcode
), (u64
*)frame
->retcode
);
299 /* Set up registers for signal handler */
300 regs
->sp
= (unsigned long)frame
;
301 regs
->ip
= (unsigned long)ka
->sa
.sa_handler
;
302 regs
->ax
= (unsigned long)sig
;
306 regs
->ds
= __USER_DS
;
307 regs
->es
= __USER_DS
;
308 regs
->ss
= __USER_DS
;
309 regs
->cs
= __USER_CS
;
314 static int __setup_rt_frame(int sig
, struct k_sigaction
*ka
, siginfo_t
*info
,
315 sigset_t
*set
, struct pt_regs
*regs
)
317 struct rt_sigframe __user
*frame
;
318 void __user
*restorer
;
320 void __user
*fpstate
= NULL
;
322 frame
= get_sigframe(ka
, regs
, sizeof(*frame
), &fpstate
);
324 if (!access_ok(VERIFY_WRITE
, frame
, sizeof(*frame
)))
327 err
|= __put_user(sig
, &frame
->sig
);
328 err
|= __put_user(&frame
->info
, &frame
->pinfo
);
329 err
|= __put_user(&frame
->uc
, &frame
->puc
);
330 err
|= copy_siginfo_to_user(&frame
->info
, info
);
334 /* Create the ucontext. */
336 err
|= __put_user(UC_FP_XSTATE
, &frame
->uc
.uc_flags
);
338 err
|= __put_user(0, &frame
->uc
.uc_flags
);
339 err
|= __put_user(0, &frame
->uc
.uc_link
);
340 err
|= __put_user(current
->sas_ss_sp
, &frame
->uc
.uc_stack
.ss_sp
);
341 err
|= __put_user(sas_ss_flags(regs
->sp
),
342 &frame
->uc
.uc_stack
.ss_flags
);
343 err
|= __put_user(current
->sas_ss_size
, &frame
->uc
.uc_stack
.ss_size
);
344 err
|= setup_sigcontext(&frame
->uc
.uc_mcontext
, fpstate
,
346 err
|= __copy_to_user(&frame
->uc
.uc_sigmask
, set
, sizeof(*set
));
350 /* Set up to return from userspace. */
351 restorer
= VDSO32_SYMBOL(current
->mm
->context
.vdso
, rt_sigreturn
);
352 if (ka
->sa
.sa_flags
& SA_RESTORER
)
353 restorer
= ka
->sa
.sa_restorer
;
354 err
|= __put_user(restorer
, &frame
->pretcode
);
357 * This is movl $__NR_rt_sigreturn, %ax ; int $0x80
359 * WE DO NOT USE IT ANY MORE! It's only left here for historical
360 * reasons and because gdb uses it as a signature to notice
361 * signal handler stack frames.
363 err
|= __put_user(*((u64
*)&rt_retcode
), (u64
*)frame
->retcode
);
368 /* Set up registers for signal handler */
369 regs
->sp
= (unsigned long)frame
;
370 regs
->ip
= (unsigned long)ka
->sa
.sa_handler
;
371 regs
->ax
= (unsigned long)sig
;
372 regs
->dx
= (unsigned long)&frame
->info
;
373 regs
->cx
= (unsigned long)&frame
->uc
;
375 regs
->ds
= __USER_DS
;
376 regs
->es
= __USER_DS
;
377 regs
->ss
= __USER_DS
;
378 regs
->cs
= __USER_CS
;
382 #else /* !CONFIG_X86_32 */
384 * Determine which stack to use..
387 get_stack(struct k_sigaction
*ka
, unsigned long sp
, unsigned long size
)
389 /* Default to using normal stack - redzone*/
392 /* This is the X/Open sanctioned signal stack switching. */
393 if (ka
->sa
.sa_flags
& SA_ONSTACK
) {
394 if (sas_ss_flags(sp
) == 0)
395 sp
= current
->sas_ss_sp
+ current
->sas_ss_size
;
398 return (void __user
*)round_down(sp
- size
, 64);
401 static int __setup_rt_frame(int sig
, struct k_sigaction
*ka
, siginfo_t
*info
,
402 sigset_t
*set
, struct pt_regs
*regs
)
404 struct rt_sigframe __user
*frame
;
405 void __user
*fp
= NULL
;
407 struct task_struct
*me
= current
;
410 fp
= get_stack(ka
, regs
->sp
, sig_xstate_size
);
411 frame
= (void __user
*)round_down(
412 (unsigned long)fp
- sizeof(struct rt_sigframe
), 16) - 8;
414 if (save_i387_xstate(fp
) < 0)
417 frame
= get_stack(ka
, regs
->sp
, sizeof(struct rt_sigframe
)) - 8;
419 if (!access_ok(VERIFY_WRITE
, frame
, sizeof(*frame
)))
422 if (ka
->sa
.sa_flags
& SA_SIGINFO
) {
423 if (copy_siginfo_to_user(&frame
->info
, info
))
427 /* Create the ucontext. */
429 err
|= __put_user(UC_FP_XSTATE
, &frame
->uc
.uc_flags
);
431 err
|= __put_user(0, &frame
->uc
.uc_flags
);
432 err
|= __put_user(0, &frame
->uc
.uc_link
);
433 err
|= __put_user(me
->sas_ss_sp
, &frame
->uc
.uc_stack
.ss_sp
);
434 err
|= __put_user(sas_ss_flags(regs
->sp
),
435 &frame
->uc
.uc_stack
.ss_flags
);
436 err
|= __put_user(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 err
|= __put_user(ka
->sa
.sa_restorer
, &frame
->pretcode
);
446 /* could use a vstub here */
453 /* Set up registers for signal handler */
455 /* In case the signal handler was declared without prototypes */
458 /* This also works for non SA_SIGINFO handlers because they expect the
459 next argument after the signal number on the stack. */
460 regs
->si
= (unsigned long)&frame
->info
;
461 regs
->dx
= (unsigned long)&frame
->uc
;
462 regs
->ip
= (unsigned long) ka
->sa
.sa_handler
;
464 regs
->sp
= (unsigned long)frame
;
466 /* Set up the CS register to run signal handlers in 64-bit mode,
467 even if the handler happens to be interrupting 32-bit code. */
468 regs
->cs
= __USER_CS
;
472 #endif /* CONFIG_X86_32 */
475 asmlinkage
int sys_sigaltstack(unsigned long bx
)
478 * This is needed to make gcc realize it doesn't own the
481 struct pt_regs
*regs
= (struct pt_regs
*)&bx
;
482 const stack_t __user
*uss
= (const stack_t __user
*)bx
;
483 stack_t __user
*uoss
= (stack_t __user
*)regs
->cx
;
485 return do_sigaltstack(uss
, uoss
, regs
->sp
);
487 #else /* !CONFIG_X86_32 */
489 sys_sigaltstack(const stack_t __user
*uss
, stack_t __user
*uoss
,
490 struct pt_regs
*regs
)
492 return do_sigaltstack(uss
, uoss
, regs
->sp
);
494 #endif /* CONFIG_X86_32 */
497 * Do a signal return; undo the signal stack.
499 static long do_rt_sigreturn(struct pt_regs
*regs
)
501 struct rt_sigframe __user
*frame
;
505 frame
= (struct rt_sigframe __user
*)(regs
->sp
- sizeof(long));
506 if (!access_ok(VERIFY_READ
, frame
, sizeof(*frame
)))
508 if (__copy_from_user(&set
, &frame
->uc
.uc_sigmask
, sizeof(set
)))
511 sigdelsetmask(&set
, ~_BLOCKABLE
);
512 spin_lock_irq(¤t
->sighand
->siglock
);
513 current
->blocked
= set
;
515 spin_unlock_irq(¤t
->sighand
->siglock
);
517 if (restore_sigcontext(regs
, &frame
->uc
.uc_mcontext
, &ax
))
520 if (do_sigaltstack(&frame
->uc
.uc_stack
, NULL
, regs
->sp
) == -EFAULT
)
526 signal_fault(regs
, frame
, "rt_sigreturn");
531 asmlinkage
int sys_rt_sigreturn(unsigned long __unused
)
533 struct pt_regs
*regs
= (struct pt_regs
*)&__unused
;
535 return do_rt_sigreturn(regs
);
537 #else /* !CONFIG_X86_32 */
538 asmlinkage
long sys_rt_sigreturn(struct pt_regs
*regs
)
540 return do_rt_sigreturn(regs
);
542 #endif /* CONFIG_X86_32 */
545 * OK, we're invoking a handler
547 static int signr_convert(int sig
)
550 struct thread_info
*info
= current_thread_info();
552 if (info
->exec_domain
&& info
->exec_domain
->signal_invmap
&& sig
< 32)
553 return info
->exec_domain
->signal_invmap
[sig
];
554 #endif /* CONFIG_X86_32 */
561 #define ia32_setup_frame __setup_frame
562 #define ia32_setup_rt_frame __setup_rt_frame
564 #else /* !CONFIG_X86_32 */
566 #ifdef CONFIG_IA32_EMULATION
567 #define is_ia32 test_thread_flag(TIF_IA32)
568 #else /* !CONFIG_IA32_EMULATION */
570 #endif /* CONFIG_IA32_EMULATION */
572 #endif /* CONFIG_X86_32 */
575 setup_rt_frame(int sig
, struct k_sigaction
*ka
, siginfo_t
*info
,
576 sigset_t
*set
, struct pt_regs
*regs
)
578 int usig
= signr_convert(sig
);
581 /* Set up the stack frame */
583 if (ka
->sa
.sa_flags
& SA_SIGINFO
)
584 ret
= ia32_setup_rt_frame(usig
, ka
, info
, set
, regs
);
586 ret
= ia32_setup_frame(usig
, ka
, set
, regs
);
588 ret
= __setup_rt_frame(sig
, ka
, info
, set
, regs
);
591 force_sigsegv(sig
, current
);
599 handle_signal(unsigned long sig
, siginfo_t
*info
, struct k_sigaction
*ka
,
600 sigset_t
*oldset
, struct pt_regs
*regs
)
604 /* Are we from a system call? */
605 if (syscall_get_nr(current
, regs
) >= 0) {
606 /* If so, check system call restarting.. */
607 switch (syscall_get_error(current
, regs
)) {
608 case -ERESTART_RESTARTBLOCK
:
609 case -ERESTARTNOHAND
:
614 if (!(ka
->sa
.sa_flags
& SA_RESTART
)) {
619 case -ERESTARTNOINTR
:
620 regs
->ax
= regs
->orig_ax
;
627 * If TF is set due to a debugger (TIF_FORCED_TF), clear the TF
628 * flag so that register information in the sigcontext is correct.
630 if (unlikely(regs
->flags
& X86_EFLAGS_TF
) &&
631 likely(test_and_clear_thread_flag(TIF_FORCED_TF
)))
632 regs
->flags
&= ~X86_EFLAGS_TF
;
634 ret
= setup_rt_frame(sig
, ka
, info
, oldset
, regs
);
641 * This has nothing to do with segment registers,
642 * despite the name. This magic affects uaccess.h
643 * macros' behavior. Reset it to the normal setting.
649 * Clear the direction flag as per the ABI for function entry.
651 regs
->flags
&= ~X86_EFLAGS_DF
;
654 * Clear TF when entering the signal handler, but
655 * notify any tracer that was single-stepping it.
656 * The tracer may want to single-step inside the
659 regs
->flags
&= ~X86_EFLAGS_TF
;
661 spin_lock_irq(¤t
->sighand
->siglock
);
662 sigorsets(¤t
->blocked
, ¤t
->blocked
, &ka
->sa
.sa_mask
);
663 if (!(ka
->sa
.sa_flags
& SA_NODEFER
))
664 sigaddset(¤t
->blocked
, sig
);
666 spin_unlock_irq(¤t
->sighand
->siglock
);
668 tracehook_signal_handler(sig
, info
, ka
, regs
,
669 test_thread_flag(TIF_SINGLESTEP
));
675 #define NR_restart_syscall __NR_restart_syscall
676 #else /* !CONFIG_X86_32 */
677 #define NR_restart_syscall \
678 test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : __NR_restart_syscall
679 #endif /* CONFIG_X86_32 */
682 * Note that 'init' is a special process: it doesn't get signals it doesn't
683 * want to handle. Thus you cannot kill init even with a SIGKILL even by
686 static void do_signal(struct pt_regs
*regs
)
688 struct k_sigaction ka
;
694 * We want the common case to go fast, which is why we may in certain
695 * cases get here from kernel mode. Just return without doing anything
697 * X86_32: vm86 regs switched out by assembly code before reaching
698 * here, so testing against kernel CS suffices.
700 if (!user_mode(regs
))
703 if (current_thread_info()->status
& TS_RESTORE_SIGMASK
)
704 oldset
= ¤t
->saved_sigmask
;
706 oldset
= ¤t
->blocked
;
708 signr
= get_signal_to_deliver(&info
, &ka
, regs
, NULL
);
711 * Re-enable any watchpoints before delivering the
712 * signal to user space. The processor register will
713 * have been cleared if the watchpoint triggered
716 if (current
->thread
.debugreg7
)
717 set_debugreg(current
->thread
.debugreg7
, 7);
719 /* Whee! Actually deliver the signal. */
720 if (handle_signal(signr
, &info
, &ka
, oldset
, regs
) == 0) {
722 * A signal was successfully delivered; the saved
723 * sigmask will have been stored in the signal frame,
724 * and will be restored by sigreturn, so we can simply
725 * clear the TS_RESTORE_SIGMASK flag.
727 current_thread_info()->status
&= ~TS_RESTORE_SIGMASK
;
732 /* Did we come from a system call? */
733 if (syscall_get_nr(current
, regs
) >= 0) {
734 /* Restart the system call - no handlers present */
735 switch (syscall_get_error(current
, regs
)) {
736 case -ERESTARTNOHAND
:
738 case -ERESTARTNOINTR
:
739 regs
->ax
= regs
->orig_ax
;
743 case -ERESTART_RESTARTBLOCK
:
744 regs
->ax
= NR_restart_syscall
;
751 * If there's no signal to deliver, we just put the saved sigmask
754 if (current_thread_info()->status
& TS_RESTORE_SIGMASK
) {
755 current_thread_info()->status
&= ~TS_RESTORE_SIGMASK
;
756 sigprocmask(SIG_SETMASK
, ¤t
->saved_sigmask
, NULL
);
761 * notification of userspace execution resumption
762 * - triggered by the TIF_WORK_MASK flags
765 do_notify_resume(struct pt_regs
*regs
, void *unused
, __u32 thread_info_flags
)
767 #if defined(CONFIG_X86_64) && defined(CONFIG_X86_MCE)
768 /* notify userspace of pending MCEs */
769 if (thread_info_flags
& _TIF_MCE_NOTIFY
)
771 #endif /* CONFIG_X86_64 && CONFIG_X86_MCE */
773 /* deal with pending signal delivery */
774 if (thread_info_flags
& _TIF_SIGPENDING
)
777 if (thread_info_flags
& _TIF_NOTIFY_RESUME
) {
778 clear_thread_flag(TIF_NOTIFY_RESUME
);
779 tracehook_notify_resume(regs
);
783 clear_thread_flag(TIF_IRET
);
784 #endif /* CONFIG_X86_32 */
787 void signal_fault(struct pt_regs
*regs
, void __user
*frame
, char *where
)
789 struct task_struct
*me
= current
;
791 if (show_unhandled_signals
&& printk_ratelimit()) {
793 "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx",
794 me
->comm
, me
->pid
, where
, frame
,
795 regs
->ip
, regs
->sp
, regs
->orig_ax
);
796 print_vma_addr(" in ", regs
->ip
);
797 printk(KERN_CONT
"\n");
800 force_sig(SIGSEGV
, me
);