Return-Path: Received: from m12-17.163.com ([220.181.12.17]:49404 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752002AbcJPLSs (ORCPT ); Sun, 16 Oct 2016 07:18:48 -0400 From: Mark Subject: Can I move a kernel thread into a special mount namespace To: linux-fsdevel@vger.kernel.org Message-ID: <69ad7e46-26ae-2e7b-3eda-31a676203fac@163.com> Date: Sun, 16 Oct 2016 19:18:43 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, Our requirement is, a user process sends a command to a kernel (3.10) module, and the kernel module creates a kernel thread, which has to be in same mount space with the user process since they have to access a same path, which is not mounted in root namespace. But seems all kernel threads have one parent "threadd", which is in root name space. My question is, can I create a kernel thread with a special mount space(e.g, same with "current"), or move it after it is created? I have checked the setns syscall kernel source but still have no idea. I also have posted this question in stackoverflow but got no answer: http://stackoverflow.com/questions/39869545/can-i-move-a-kernel-thread-from-one-namespace-to-another Thank you very much.