• Oleg Nesterov's avatar
    kmod: don't run async usermode helper as a child of kworker thread · 52116139
    Oleg Nesterov authored
    call_usermodehelper_exec_sync() does fork() + wait() with "unignored"
    SIGCHLD.  What we have missed is that this worker thread can have other
    children previously forked by call_usermodehelper_exec_work() without
    UMH_WAIT_PROC.  If such a child exits in between it becomes a zombie
    because auto-reaping only works if SIGCHLD is ignored, and nobody can
    reap it (unless/until this worker thread exits too).
    
    Change the !UMH_WAIT_PROC case to use CLONE_PARENT.
    
    Note: this is only first step.  All PF_KTHREAD tasks, even created by
    kernel_thread() should have ->parent == kthreadd by default.
    
    Fixes: bb304a5c
    
     ("kmod: handle UMH_WAIT_PROC from system unbound workqueue")
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Acked-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Rusty Russell <rusty@rustcorp.com.au>
    Signed-off-by: Andrew Morton <akp...
    52116139
kmod.c 19.1 KB