linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Can I move a kernel thread into a special mount namespace
@ 2016-10-16 11:18 Mark
  2016-10-26 12:31 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Mark @ 2016-10-16 11:18 UTC (permalink / raw)
  To: linux-fsdevel

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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can I move a kernel thread into a special mount namespace
  2016-10-16 11:18 Can I move a kernel thread into a special mount namespace Mark
@ 2016-10-26 12:31 ` Greg KH
  2016-11-13  8:50   ` Mark
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2016-10-26 12:31 UTC (permalink / raw)
  To: Mark; +Cc: linux-fsdevel

On Sun, Oct 16, 2016 at 07:18:43PM +0800, Mark wrote:
> 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.

Very odd requirement, do you have a pointer to your code anywhere?  What
exactly will that kernel thread do?

And why use such an obsolete and old kernel version?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can I move a kernel thread into a special mount namespace
  2016-10-26 12:31 ` Greg KH
@ 2016-11-13  8:50   ` Mark
  2016-11-13  9:43     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Mark @ 2016-11-13  8:50 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-fsdevel



On 2016/10/26 20:31, Greg KH Wrote:
> On Sun, Oct 16, 2016 at 07:18:43PM +0800, Mark wrote:
>> 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.
>
> Very odd requirement, do you have a pointer to your code anywhere?  What
> exactly will that kernel thread do?
>
> And why use such an obsolete and old kernel version?
>
> thanks,
>
> greg k-h
>

The kernel thread checks a file and if it exists then do something, but
the file is created in a separate namespace. Is this an odd requirement?
I cannot post the code. It's on an android release so kernel is 3.10. Is
there a solution on a newer kernel release?

Thank you very much, and sorry for late response:)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can I move a kernel thread into a special mount namespace
  2016-11-13  8:50   ` Mark
@ 2016-11-13  9:43     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2016-11-13  9:43 UTC (permalink / raw)
  To: Mark; +Cc: linux-fsdevel

On Sun, Nov 13, 2016 at 04:50:09PM +0800, Mark wrote:
> 
> 
> On 2016/10/26 20:31, Greg KH Wrote:
> > On Sun, Oct 16, 2016 at 07:18:43PM +0800, Mark wrote:
> > > 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.
> > 
> > Very odd requirement, do you have a pointer to your code anywhere?  What
> > exactly will that kernel thread do?
> > 
> > And why use such an obsolete and old kernel version?
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> The kernel thread checks a file and if it exists then do something, but
> the file is created in a separate namespace. Is this an odd requirement?

Yes, why should the kernel care about a file, the kernel should never be
reading files directly from userspace.

> I cannot post the code.

Why not?  You have our code, why can't you post yours?  :)

> It's on an android release so kernel is 3.10. Is there a solution on a
> newer kernel release?

I don't understand the problem you are trying to solve, can you perhaps
explain the issue, not the potential solution you are trying to use?
That would make it easier to understand.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-13  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-16 11:18 Can I move a kernel thread into a special mount namespace Mark
2016-10-26 12:31 ` Greg KH
2016-11-13  8:50   ` Mark
2016-11-13  9:43     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).