diff options
-rw-r--r-- | include/linux/sched.h | 1 | ||||
-rw-r--r-- | kernel/signal.c | 11 | ||||
-rw-r--r-- | security/selinux/hooks.c | 9 |
3 files changed, 14 insertions, 7 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 1d19c025f9d2..d3b787c7aef3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1875,6 +1875,7 @@ extern void sched_dead(struct task_struct *p); | |||
1875 | 1875 | ||
1876 | extern void proc_caches_init(void); | 1876 | extern void proc_caches_init(void); |
1877 | extern void flush_signals(struct task_struct *); | 1877 | extern void flush_signals(struct task_struct *); |
1878 | extern void __flush_signals(struct task_struct *); | ||
1878 | extern void ignore_signals(struct task_struct *); | 1879 | extern void ignore_signals(struct task_struct *); |
1879 | extern void flush_signal_handlers(struct task_struct *, int force_default); | 1880 | extern void flush_signal_handlers(struct task_struct *, int force_default); |
1880 | extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info); | 1881 | extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info); |
diff --git a/kernel/signal.c b/kernel/signal.c index 1c8814481a11..f93efec14ff5 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -238,14 +238,19 @@ void flush_sigqueue(struct sigpending *queue) | |||
238 | /* | 238 | /* |
239 | * Flush all pending signals for a task. | 239 | * Flush all pending signals for a task. |
240 | */ | 240 | */ |
241 | void __flush_signals(struct task_struct *t) | ||
242 | { | ||
243 | clear_tsk_thread_flag(t, TIF_SIGPENDING); | ||
244 | flush_sigqueue(&t->pending); | ||
245 | flush_sigqueue(&t->signal->shared_pending); | ||
246 | } | ||
247 | |||
241 | void flush_signals(struct task_struct *t) | 248 | void flush_signals(struct task_struct *t) |
242 | { | 249 | { |
243 | unsigned long flags; | 250 | unsigned long flags; |
244 | 251 | ||
245 | spin_lock_irqsave(&t->sighand->siglock, flags); | 252 | spin_lock_irqsave(&t->sighand->siglock, flags); |
246 | clear_tsk_thread_flag(t, TIF_SIGPENDING); | 253 | __flush_signals(t); |
247 | flush_sigqueue(&t->pending); | ||
248 | flush_sigqueue(&t->signal->shared_pending); | ||
249 | spin_unlock_irqrestore(&t->sighand->siglock, flags); | 254 | spin_unlock_irqrestore(&t->sighand->siglock, flags); |
250 | } | 255 | } |
251 | 256 | ||
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index dd19ba81201f..5a345115036c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -2394,11 +2394,12 @@ static void selinux_bprm_committed_creds(struct linux_binprm *bprm) | |||
2394 | memset(&itimer, 0, sizeof itimer); | 2394 | memset(&itimer, 0, sizeof itimer); |
2395 | for (i = 0; i < 3; i++) | 2395 | for (i = 0; i < 3; i++) |
2396 | do_setitimer(i, &itimer, NULL); | 2396 | do_setitimer(i, &itimer, NULL); |
2397 | flush_signals(current); | ||
2398 | spin_lock_irq(¤t->sighand->siglock); | 2397 | spin_lock_irq(¤t->sighand->siglock); |
2399 | flush_signal_handlers(current, 1); | 2398 | if (!(current->signal->flags & SIGNAL_GROUP_EXIT)) { |
2400 | sigemptyset(¤t->blocked); | 2399 | __flush_signals(current); |
2401 | recalc_sigpending(); | 2400 | flush_signal_handlers(current, 1); |
2401 | sigemptyset(¤t->blocked); | ||
2402 | } | ||
2402 | spin_unlock_irq(¤t->sighand->siglock); | 2403 | spin_unlock_irq(¤t->sighand->siglock); |
2403 | } | 2404 | } |
2404 | 2405 | ||