Tetsuo Handa 786235eeba kthread: make kthread_create() killable
Any user process callers of wait_for_completion() except global init
process might be chosen by the OOM killer while waiting for completion()
call by some other process which does memory allocation.  See
CVE-2012-4398 "kernel: request_module() OOM local DoS" can happen.

When such users are chosen by the OOM killer when they are waiting for
completion() in TASK_UNINTERRUPTIBLE, the system will be kept stressed
due to memory starvation because the OOM killer cannot kill such users.

kthread_create() is one of such users and this patch fixes the problem
for kthreadd by making kthread_create() killable - the same approach
used for fixing CVE-2012-4398.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-13 12:08:59 +09:00
..
2013-04-22 07:09:06 -07:00
2013-09-09 11:19:09 -07:00
2013-10-09 12:36:13 +02:00
2012-05-31 17:49:27 -07:00
2013-10-16 14:22:16 +02:00
2012-03-28 18:30:03 +01:00
2013-06-25 23:11:19 +02:00
2012-12-20 17:40:19 -08:00
2013-09-11 15:59:10 -07:00
2013-09-11 15:58:27 -07:00
2013-04-29 13:55:38 -07:00