diff options
Diffstat (limited to 'arch/hexagon/kernel/signal.c')
| -rw-r--r-- | arch/hexagon/kernel/signal.c | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c index 434866eb0f1c..304b0808d072 100644 --- a/arch/hexagon/kernel/signal.c +++ b/arch/hexagon/kernel/signal.c | |||
| @@ -31,8 +31,6 @@ | |||
| 31 | #include <asm/signal.h> | 31 | #include <asm/signal.h> |
| 32 | #include <asm/vdso.h> | 32 | #include <asm/vdso.h> |
| 33 | 33 | ||
| 34 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
| 35 | |||
| 36 | struct rt_sigframe { | 34 | struct rt_sigframe { |
| 37 | unsigned long tramp[2]; | 35 | unsigned long tramp[2]; |
| 38 | struct siginfo info; | 36 | struct siginfo info; |
| @@ -149,11 +147,9 @@ sigsegv: | |||
| 149 | /* | 147 | /* |
| 150 | * Setup invocation of signal handler | 148 | * Setup invocation of signal handler |
| 151 | */ | 149 | */ |
| 152 | static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka, | 150 | static void handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka, |
| 153 | sigset_t *oldset, struct pt_regs *regs) | 151 | struct pt_regs *regs) |
| 154 | { | 152 | { |
| 155 | int rc; | ||
| 156 | |||
| 157 | /* | 153 | /* |
| 158 | * If we're handling a signal that aborted a system call, | 154 | * If we're handling a signal that aborted a system call, |
| 159 | * set up the error return value before adding the signal | 155 | * set up the error return value before adding the signal |
| @@ -186,15 +182,12 @@ static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka, | |||
| 186 | * Set up the stack frame; not doing the SA_SIGINFO thing. We | 182 | * Set up the stack frame; not doing the SA_SIGINFO thing. We |
| 187 | * only set up the rt_frame flavor. | 183 | * only set up the rt_frame flavor. |
| 188 | */ | 184 | */ |
| 189 | rc = setup_rt_frame(sig, ka, info, oldset, regs); | ||
| 190 | |||
| 191 | /* If there was an error on setup, no signal was delivered. */ | 185 | /* If there was an error on setup, no signal was delivered. */ |
| 192 | if (rc) | 186 | if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs) < 0) |
| 193 | return rc; | 187 | return; |
| 194 | |||
| 195 | block_sigmask(ka, sig); | ||
| 196 | 188 | ||
| 197 | return 0; | 189 | signal_delivered(sig, info, ka, regs, |
| 190 | test_thread_flag(TIF_SINGLESTEP)); | ||
| 198 | } | 191 | } |
| 199 | 192 | ||
| 200 | /* | 193 | /* |
| @@ -209,34 +202,13 @@ static void do_signal(struct pt_regs *regs) | |||
| 209 | if (!user_mode(regs)) | 202 | if (!user_mode(regs)) |
| 210 | return; | 203 | return; |
| 211 | 204 | ||
| 212 | if (try_to_freeze()) | ||
| 213 | goto no_signal; | ||
| 214 | |||
| 215 | signo = get_signal_to_deliver(&info, &sigact, regs, NULL); | 205 | signo = get_signal_to_deliver(&info, &sigact, regs, NULL); |
| 216 | 206 | ||
| 217 | if (signo > 0) { | 207 | if (signo > 0) { |
| 218 | sigset_t *oldset; | 208 | handle_signal(signo, &info, &sigact, regs); |
| 219 | |||
| 220 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
| 221 | oldset = ¤t->saved_sigmask; | ||
| 222 | else | ||
| 223 | oldset = ¤t->blocked; | ||
| 224 | |||
| 225 | if (handle_signal(signo, &info, &sigact, oldset, regs) == 0) { | ||
| 226 | /* | ||
| 227 | * Successful delivery case. The saved sigmask is | ||
| 228 | * stored in the signal frame, and will be restored | ||
| 229 | * by sigreturn. We can clear the TIF flag. | ||
| 230 | */ | ||
| 231 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
| 232 | |||
| 233 | tracehook_signal_handler(signo, &info, &sigact, regs, | ||
| 234 | test_thread_flag(TIF_SINGLESTEP)); | ||
| 235 | } | ||
| 236 | return; | 209 | return; |
| 237 | } | 210 | } |
| 238 | 211 | ||
| 239 | no_signal: | ||
| 240 | /* | 212 | /* |
| 241 | * If we came from a system call, handle the restart. | 213 | * If we came from a system call, handle the restart. |
| 242 | */ | 214 | */ |
| @@ -259,10 +231,7 @@ no_signal: | |||
| 259 | 231 | ||
| 260 | no_restart: | 232 | no_restart: |
| 261 | /* If there's no signal to deliver, put the saved sigmask back */ | 233 | /* If there's no signal to deliver, put the saved sigmask back */ |
| 262 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | 234 | restore_saved_sigmask(); |
| 263 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
| 264 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
| 265 | } | ||
| 266 | } | 235 | } |
| 267 | 236 | ||
| 268 | void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) | 237 | void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) |
| @@ -273,8 +242,6 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) | |||
| 273 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | 242 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
| 274 | clear_thread_flag(TIF_NOTIFY_RESUME); | 243 | clear_thread_flag(TIF_NOTIFY_RESUME); |
| 275 | tracehook_notify_resume(regs); | 244 | tracehook_notify_resume(regs); |
| 276 | if (current->replacement_session_keyring) | ||
| 277 | key_replace_session_keyring(); | ||
| 278 | } | 245 | } |
| 279 | } | 246 | } |
| 280 | 247 | ||
| @@ -303,7 +270,6 @@ asmlinkage int sys_rt_sigreturn(void) | |||
| 303 | if (__copy_from_user(&blocked, &frame->uc.uc_sigmask, sizeof(blocked))) | 270 | if (__copy_from_user(&blocked, &frame->uc.uc_sigmask, sizeof(blocked))) |
| 304 | goto badframe; | 271 | goto badframe; |
| 305 | 272 | ||
| 306 | sigdelsetmask(&blocked, ~_BLOCKABLE); | ||
| 307 | set_current_blocked(&blocked); | 273 | set_current_blocked(&blocked); |
| 308 | 274 | ||
| 309 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 275 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
