From: Eric W. Biederman Since the kthread api does not bump the reference count on processes that tracked it is not safe allow user space to kill the threads, as I still retain a pointer to the task_struct. Signed-off-by: Eric W. Biederman Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton --- fs/9p/mux.c | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-) diff -puN fs/9p/mux.c~9p-use-kthread_stop-instead-of-sending-a-sigkill fs/9p/mux.c --- a/fs/9p/mux.c~9p-use-kthread_stop-instead-of-sending-a-sigkill +++ a/fs/9p/mux.c @@ -254,7 +254,7 @@ static void v9fs_mux_poll_stop(struct v9 vpt->muxnum--; if (!vpt->muxnum) { dprintk(DEBUG_MUX, "destroy proc %p\n", vpt); - send_sig(SIGKILL, vpt->task, 1); + kthread_stop(vpt->task); vpt->task = NULL; v9fs_mux_poll_task_num--; } @@ -436,11 +436,8 @@ static int v9fs_poll_proc(void *a) vpt = a; dprintk(DEBUG_MUX, "start %p %p\n", current, vpt); - allow_signal(SIGKILL); while (!kthread_should_stop()) { set_current_state(TASK_INTERRUPTIBLE); - if (signal_pending(current)) - break; list_for_each_entry_safe(m, mtmp, &vpt->mux_list, mux_list) { v9fs_poll_mux(m); _