From: Rusty Russell Kthreads created at boot before "keventd" are spawned directly. However, this means that they don't have all signals blocked, and hence can be killed. The simplest solution is to always explicitly block all signals in the kthread. --- kernel/kthread.c | 6 ++++++ 1 files changed, 6 insertions(+) diff -puN kernel/kthread.c~kthread-block-all-signals kernel/kthread.c --- 25/kernel/kthread.c~kthread-block-all-signals 2004-01-19 11:22:44.000000000 -0800 +++ 25-akpm/kernel/kthread.c 2004-01-19 11:22:44.000000000 -0800 @@ -32,12 +32,18 @@ static int kthread(void *_create) struct kthread_create_info *create = _create; int (*threadfn)(void *data); void *data; + sigset_t blocked; int ret = -EINTR; /* Copy data: it's on keventd's stack */ threadfn = create->threadfn; data = create->data; + /* Block and flush all signals (in case we're not from keventd). */ + sigfillset(&blocked); + sigprocmask(SIG_BLOCK, &blocked, NULL); + flush_signals(current); + /* OK, tell user we're spawned, wait for stop or wakeup */ __set_current_state(TASK_INTERRUPTIBLE); complete(&create->started); _