]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kthread: make kthread_create() killable
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tue, 5 Nov 2013 05:54:46 +0000 (16:54 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:54:46 +0000 (16:54 +1100)
commitdf5494a362633e8e72bc1ff72b53b8f05d75f77d
tree744ea93f21356ee18df766dc6cefd3e5cb42ac47
parentbe408cd3e1fef73e9408b196a79b9934697fe3b1
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>
kernel/kthread.c
mm/bounce.c