diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-01 14:53:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-01 14:53:44 -0400 |
commit | 86c47b70f62a7072d441ba212aab33c2f82627c2 (patch) | |
tree | d03988bd2226966352bb7f3c2e82ff545353d2c4 /arch/m68k | |
parent | 1193755ac6328ad240ba987e6ec41d5e8baf0680 (diff) | |
parent | 44fbbb3dc687c9709a6f2236197316e5c79ab1eb (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull third pile of signal handling patches from Al Viro:
"This time it's mostly helpers and conversions to them; there's a lot
of stuff remaining in the tree, but that'll either go in -rc2
(isolated bug fixes, ideally via arch maintainers' trees) or will sit
there until the next cycle."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
x86: get rid of calling do_notify_resume() when returning to kernel mode
blackfin: check __get_user() return value
whack-a-mole with TIF_FREEZE
FRV: Optimise the system call exit path in entry.S [ver #2]
FRV: Shrink TIF_WORK_MASK [ver #2]
FRV: Prevent syscall exit tracing and notify_resume at end of kernel exceptions
new helper: signal_delivered()
powerpc: get rid of restore_sigmask()
most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from set
set_restore_sigmask() is never called without SIGPENDING (and never should be)
TIF_RESTORE_SIGMASK can be set only when TIF_SIGPENDING is set
don't call try_to_freeze() from do_signal()
pull clearing RESTORE_SIGMASK into block_sigmask()
sh64: failure to build sigframe != signal without handler
openrisc: tracehook_signal_handler() is supposed to be called on success
new helper: sigmask_to_save()
new helper: restore_saved_sigmask()
new helpers: {clear,test,test_and_clear}_restore_sigmask()
HAVE_RESTORE_SIGMASK is defined on all architectures now
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/kernel/signal.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index 973eec60cad4..710a528b928b 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c | |||
@@ -51,8 +51,6 @@ | |||
51 | #include <asm/traps.h> | 51 | #include <asm/traps.h> |
52 | #include <asm/ucontext.h> | 52 | #include <asm/ucontext.h> |
53 | 53 | ||
54 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
55 | |||
56 | #ifdef CONFIG_MMU | 54 | #ifdef CONFIG_MMU |
57 | 55 | ||
58 | /* | 56 | /* |
@@ -795,7 +793,6 @@ asmlinkage int do_sigreturn(unsigned long __unused) | |||
795 | sizeof(frame->extramask)))) | 793 | sizeof(frame->extramask)))) |
796 | goto badframe; | 794 | goto badframe; |
797 | 795 | ||
798 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
799 | set_current_blocked(&set); | 796 | set_current_blocked(&set); |
800 | 797 | ||
801 | if (restore_sigcontext(regs, &frame->sc, frame + 1)) | 798 | if (restore_sigcontext(regs, &frame->sc, frame + 1)) |
@@ -820,7 +817,6 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused) | |||
820 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 817 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
821 | goto badframe; | 818 | goto badframe; |
822 | 819 | ||
823 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
824 | set_current_blocked(&set); | 820 | set_current_blocked(&set); |
825 | 821 | ||
826 | if (rt_restore_ucontext(regs, sw, &frame->uc)) | 822 | if (rt_restore_ucontext(regs, sw, &frame->uc)) |
@@ -1123,8 +1119,9 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler) | |||
1123 | */ | 1119 | */ |
1124 | static void | 1120 | static void |
1125 | handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, | 1121 | handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, |
1126 | sigset_t *oldset, struct pt_regs *regs) | 1122 | struct pt_regs *regs) |
1127 | { | 1123 | { |
1124 | sigset_t *oldset = sigmask_to_save(); | ||
1128 | int err; | 1125 | int err; |
1129 | /* are we from a system call? */ | 1126 | /* are we from a system call? */ |
1130 | if (regs->orig_d0 >= 0) | 1127 | if (regs->orig_d0 >= 0) |
@@ -1140,14 +1137,12 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
1140 | if (err) | 1137 | if (err) |
1141 | return; | 1138 | return; |
1142 | 1139 | ||
1143 | block_sigmask(ka, sig); | 1140 | signal_delivered(sig, info, ka, regs, 0); |
1144 | 1141 | ||
1145 | if (test_thread_flag(TIF_DELAYED_TRACE)) { | 1142 | if (test_thread_flag(TIF_DELAYED_TRACE)) { |
1146 | regs->sr &= ~0x8000; | 1143 | regs->sr &= ~0x8000; |
1147 | send_sig(SIGTRAP, current, 1); | 1144 | send_sig(SIGTRAP, current, 1); |
1148 | } | 1145 | } |
1149 | |||
1150 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
1151 | } | 1146 | } |
1152 | 1147 | ||
1153 | /* | 1148 | /* |
@@ -1160,19 +1155,13 @@ static void do_signal(struct pt_regs *regs) | |||
1160 | siginfo_t info; | 1155 | siginfo_t info; |
1161 | struct k_sigaction ka; | 1156 | struct k_sigaction ka; |
1162 | int signr; | 1157 | int signr; |
1163 | sigset_t *oldset; | ||
1164 | 1158 | ||
1165 | current->thread.esp0 = (unsigned long) regs; | 1159 | current->thread.esp0 = (unsigned long) regs; |
1166 | 1160 | ||
1167 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
1168 | oldset = ¤t->saved_sigmask; | ||
1169 | else | ||
1170 | oldset = ¤t->blocked; | ||
1171 | |||
1172 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 1161 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
1173 | if (signr > 0) { | 1162 | if (signr > 0) { |
1174 | /* Whee! Actually deliver the signal. */ | 1163 | /* Whee! Actually deliver the signal. */ |
1175 | handle_signal(signr, &ka, &info, oldset, regs); | 1164 | handle_signal(signr, &ka, &info, regs); |
1176 | return; | 1165 | return; |
1177 | } | 1166 | } |
1178 | 1167 | ||
@@ -1182,10 +1171,7 @@ static void do_signal(struct pt_regs *regs) | |||
1182 | handle_restart(regs, NULL, 0); | 1171 | handle_restart(regs, NULL, 0); |
1183 | 1172 | ||
1184 | /* If there's no signal to deliver, we just restore the saved mask. */ | 1173 | /* If there's no signal to deliver, we just restore the saved mask. */ |
1185 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | 1174 | restore_saved_sigmask(); |
1186 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
1187 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
1188 | } | ||
1189 | } | 1175 | } |
1190 | 1176 | ||
1191 | void do_notify_resume(struct pt_regs *regs) | 1177 | void do_notify_resume(struct pt_regs *regs) |