提交 d3a532a9 编写于 作者: A Anton Vorontsov 提交者: Greg Kroah-Hartman

sysrq: Properly check for kernel threads

There's a real possibility of killing kernel threads that might
have issued use_mm(), so kthread's mm might become non-NULL.

This patch fixes the issue by checking for PF_KTHREAD (just as
get_task_mm()).
Suggested-by: NOleg Nesterov <oleg@redhat.com>
Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: NDavid Rientjes <rientjes@google.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e502babe
......@@ -324,8 +324,11 @@ static void send_sig_all(int sig)
read_lock(&tasklist_lock);
for_each_process(p) {
if (p->mm && !is_global_init(p))
/* Not swapper, init nor kernel thread */
if (p->flags & PF_KTHREAD)
continue;
if (is_global_init(p))
continue;
force_sig(sig, p);
}
read_unlock(&tasklist_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册