aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/signal.c')
-rw-r--r--arch/x86/kernel/signal.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 56f3062c5111..700c49dcd84e 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -648,38 +648,27 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
648{ 648{
649 int usig = signr_convert(sig); 649 int usig = signr_convert(sig);
650 sigset_t *set = sigmask_to_save(); 650 sigset_t *set = sigmask_to_save();
651 int ret;
652 651
653 /* Set up the stack frame */ 652 /* Set up the stack frame */
654 if (is_ia32) { 653 if (is_ia32) {
655 if (ka->sa.sa_flags & SA_SIGINFO) 654 if (ka->sa.sa_flags & SA_SIGINFO)
656 ret = ia32_setup_rt_frame(usig, ka, info, set, regs); 655 return ia32_setup_rt_frame(usig, ka, info, set, regs);
657 else 656 else
658 ret = ia32_setup_frame(usig, ka, set, regs); 657 return ia32_setup_frame(usig, ka, set, regs);
659#ifdef CONFIG_X86_X32_ABI 658#ifdef CONFIG_X86_X32_ABI
660 } else if (is_x32) { 659 } else if (is_x32) {
661 ret = x32_setup_rt_frame(usig, ka, info, 660 return x32_setup_rt_frame(usig, ka, info,
662 (compat_sigset_t *)set, regs); 661 (compat_sigset_t *)set, regs);
663#endif 662#endif
664 } else { 663 } else {
665 ret = __setup_rt_frame(sig, ka, info, set, regs); 664 return __setup_rt_frame(sig, ka, info, set, regs);
666 } 665 }
667
668 if (ret) {
669 force_sigsegv(sig, current);
670 return -EFAULT;
671 }
672
673 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
674 return ret;
675} 666}
676 667
677static int 668static void
678handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, 669handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
679 struct pt_regs *regs) 670 struct pt_regs *regs)
680{ 671{
681 int ret;
682
683 /* Are we from a system call? */ 672 /* Are we from a system call? */
684 if (syscall_get_nr(current, regs) >= 0) { 673 if (syscall_get_nr(current, regs) >= 0) {
685 /* If so, check system call restarting.. */ 674 /* If so, check system call restarting.. */
@@ -710,10 +699,10 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
710 likely(test_and_clear_thread_flag(TIF_FORCED_TF))) 699 likely(test_and_clear_thread_flag(TIF_FORCED_TF)))
711 regs->flags &= ~X86_EFLAGS_TF; 700 regs->flags &= ~X86_EFLAGS_TF;
712 701
713 ret = setup_rt_frame(sig, ka, info, regs); 702 if (setup_rt_frame(sig, ka, info, regs) < 0) {
714 703 force_sigsegv(sig, current);
715 if (ret) 704 return;
716 return ret; 705 }
717 706
718 /* 707 /*
719 * Clear the direction flag as per the ABI for function entry. 708 * Clear the direction flag as per the ABI for function entry.
@@ -732,8 +721,6 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
732 721
733 tracehook_signal_handler(sig, info, ka, regs, 722 tracehook_signal_handler(sig, info, ka, regs,
734 test_thread_flag(TIF_SINGLESTEP)); 723 test_thread_flag(TIF_SINGLESTEP));
735
736 return 0;
737} 724}
738 725
739#ifdef CONFIG_X86_32 726#ifdef CONFIG_X86_32