diff options
author | Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> | 2008-09-05 19:27:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-06 08:54:02 -0400 |
commit | 72fa50f4ef9014f4212945b766af84ea94308903 (patch) | |
tree | a68cda12a76d130238621b6d9d0a9b13e3b3c013 | |
parent | bb57925f5057837c248b57a51181fd6b138a32f3 (diff) |
x86_32: signal: introduce signal_fault()
implement signal_fault() for 32bit.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/signal_32.c | 18 | ||||
-rw-r--r-- | include/asm-x86/ptrace.h | 4 |
2 files changed, 19 insertions, 3 deletions
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index 3e4a688bb84f..76d05d703845 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c | |||
@@ -243,7 +243,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long __unused) | |||
243 | return ax; | 243 | return ax; |
244 | 244 | ||
245 | badframe: | 245 | badframe: |
246 | force_sig(SIGSEGV, current); | 246 | signal_fault(regs, frame, "rt sigreturn"); |
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
249 | 249 | ||
@@ -669,3 +669,19 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags) | |||
669 | 669 | ||
670 | clear_thread_flag(TIF_IRET); | 670 | clear_thread_flag(TIF_IRET); |
671 | } | 671 | } |
672 | |||
673 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where) | ||
674 | { | ||
675 | struct task_struct *me = current; | ||
676 | |||
677 | if (show_unhandled_signals && printk_ratelimit()) { | ||
678 | printk(KERN_INFO | ||
679 | "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx", | ||
680 | me->comm, me->pid, where, frame, | ||
681 | regs->ip, regs->sp, regs->orig_ax); | ||
682 | print_vma_addr(" in ", regs->ip); | ||
683 | printk(KERN_CONT "\n"); | ||
684 | } | ||
685 | |||
686 | force_sig(SIGSEGV, me); | ||
687 | } | ||
diff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h index a33f027dbbea..fad807769910 100644 --- a/include/asm-x86/ptrace.h +++ b/include/asm-x86/ptrace.h | |||
@@ -144,10 +144,10 @@ convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); | |||
144 | #ifdef CONFIG_X86_32 | 144 | #ifdef CONFIG_X86_32 |
145 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | 145 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, |
146 | int error_code); | 146 | int error_code); |
147 | #else | ||
148 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | ||
149 | #endif | 147 | #endif |
150 | 148 | ||
149 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | ||
150 | |||
151 | extern long syscall_trace_enter(struct pt_regs *); | 151 | extern long syscall_trace_enter(struct pt_regs *); |
152 | extern void syscall_trace_leave(struct pt_regs *); | 152 | extern void syscall_trace_leave(struct pt_regs *); |
153 | 153 | ||