Commit 53876ab4 authored by Linus Torvalds's avatar Linus Torvalds Committed by David S. Miller

Add support for forcing default signal handlers to flush_signal_handlers().

Make kmod force default handlers before executing the user process.
parent 91837979
......@@ -821,7 +821,7 @@ int flush_old_exec(struct linux_binprm * bprm)
current->self_exec_id++;
flush_signal_handlers(current);
flush_signal_handlers(current, 0);
flush_old_files(current->files);
exit_itimers(current);
......
......@@ -534,7 +534,7 @@ extern int in_egroup_p(gid_t);
extern void proc_caches_init(void);
extern void flush_signals(struct task_struct *);
extern void flush_signal_handlers(struct task_struct *);
extern void flush_signal_handlers(struct task_struct *, int force_default);
extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info);
extern void block_all_signals(int (*notifier)(void *priv), void *priv,
sigset_t *mask);
......
......@@ -155,7 +155,7 @@ static int ____call_usermodehelper(void *data)
/* Unblock all signals. */
flush_signals(current);
spin_lock_irq(&current->sighand->siglock);
flush_signal_handlers(current);
flush_signal_handlers(current, 1);
sigemptyset(&current->blocked);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
......
......@@ -356,12 +356,12 @@ void exit_signal(struct task_struct *tsk)
*/
void
flush_signal_handlers(struct task_struct *t)
flush_signal_handlers(struct task_struct *t, int force_default)
{
int i;
struct k_sigaction *ka = &t->sighand->action[0];
for (i = _NSIG ; i != 0 ; i--) {
if (ka->sa.sa_handler != SIG_IGN)
if (force_default || ka->sa.sa_handler != SIG_IGN)
ka->sa.sa_handler = SIG_DFL;
ka->sa.sa_flags = 0;
sigemptyset(&ka->sa.sa_mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment