aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/signal.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 19316dc3eb0b..c088011f873c 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -706,11 +706,8 @@ void signal_wake_up_state(struct task_struct *t, unsigned int state)
706 * Returns 1 if any signals were found. 706 * Returns 1 if any signals were found.
707 * 707 *
708 * All callers must be holding the siglock. 708 * All callers must be holding the siglock.
709 *
710 * This version takes a sigset mask and looks at all signals,
711 * not just those in the first mask word.
712 */ 709 */
713static int rm_from_queue_full(sigset_t *mask, struct sigpending *s) 710static int flush_sigqueue_mask(sigset_t *mask, struct sigpending *s)
714{ 711{
715 struct sigqueue *q, *n; 712 struct sigqueue *q, *n;
716 sigset_t m; 713 sigset_t m;
@@ -852,18 +849,18 @@ static bool prepare_signal(int sig, struct task_struct *p, bool force)
852 * This is a stop signal. Remove SIGCONT from all queues. 849 * This is a stop signal. Remove SIGCONT from all queues.
853 */ 850 */
854 siginitset(&flush, sigmask(SIGCONT)); 851 siginitset(&flush, sigmask(SIGCONT));
855 rm_from_queue_full(&flush, &signal->shared_pending); 852 flush_sigqueue_mask(&flush, &signal->shared_pending);
856 for_each_thread(p, t) 853 for_each_thread(p, t)
857 rm_from_queue_full(&flush, &t->pending); 854 flush_sigqueue_mask(&flush, &t->pending);
858 } else if (sig == SIGCONT) { 855 } else if (sig == SIGCONT) {
859 unsigned int why; 856 unsigned int why;
860 /* 857 /*
861 * Remove all stop signals from all queues, wake all threads. 858 * Remove all stop signals from all queues, wake all threads.
862 */ 859 */
863 siginitset(&flush, SIG_KERNEL_STOP_MASK); 860 siginitset(&flush, SIG_KERNEL_STOP_MASK);
864 rm_from_queue_full(&flush, &signal->shared_pending); 861 flush_sigqueue_mask(&flush, &signal->shared_pending);
865 for_each_thread(p, t) { 862 for_each_thread(p, t) {
866 rm_from_queue_full(&flush, &t->pending); 863 flush_sigqueue_mask(&flush, &t->pending);
867 task_clear_jobctl_pending(t, JOBCTL_STOP_PENDING); 864 task_clear_jobctl_pending(t, JOBCTL_STOP_PENDING);
868 if (likely(!(t->ptrace & PT_SEIZED))) 865 if (likely(!(t->ptrace & PT_SEIZED)))
869 wake_up_state(t, __TASK_STOPPED); 866 wake_up_state(t, __TASK_STOPPED);
@@ -3102,9 +3099,9 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
3102 if (sig_handler_ignored(sig_handler(t, sig), sig)) { 3099 if (sig_handler_ignored(sig_handler(t, sig), sig)) {
3103 sigemptyset(&mask); 3100 sigemptyset(&mask);
3104 sigaddset(&mask, sig); 3101 sigaddset(&mask, sig);
3105 rm_from_queue_full(&mask, &t->signal->shared_pending); 3102 flush_sigqueue_mask(&mask, &t->signal->shared_pending);
3106 do { 3103 do {
3107 rm_from_queue_full(&mask, &t->pending); 3104 flush_sigqueue_mask(&mask, &t->pending);
3108 } while_each_thread(current, t); 3105 } while_each_thread(current, t);
3109 } 3106 }
3110 } 3107 }
@@ -3113,7 +3110,7 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
3113 return 0; 3110 return 0;
3114} 3111}
3115 3112
3116static int 3113static int
3117do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long sp) 3114do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long sp)
3118{ 3115{
3119 stack_t oss; 3116 stack_t oss;