* [PATCH RFC] nsproxy: strengthen the comment above copy_namespaces
@ 2010-04-30 18:36 Serge E. Hallyn
[not found] ` <20100430183638.GA29240-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Serge E. Hallyn @ 2010-04-30 18:36 UTC (permalink / raw)
To: Linux Containers; +Cc: Eric W. Biederman
copy_namespaces() cannot be used on a live task. There are two
reasons - it can be used to assign another task's nsproxy, which
is not legal (for a live task). And, it does not use
rcu_assign_pointer, so even when we're being extra-clever it is
unsafe.
Signed-off-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
kernel/nsproxy.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index f74e6c0..67d8f2b 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -115,6 +115,9 @@ out_ns:
/*
* called from clone. This now handles copy for nsproxy and all
* namespaces therein.
+ * Note this should only be used in fork. Specifically, tsk should
+ * not yet be a live task. See the the unshare code for how to handle
+ * that.
*/
int copy_namespaces(unsigned long flags, struct task_struct *tsk)
{
--
1.6.3.3
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <20100430183638.GA29240-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH RFC] nsproxy: strengthen the comment above copy_namespaces [not found] ` <20100430183638.GA29240-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2010-06-15 2:54 ` Oren Laadan [not found] ` <4C16EB55.1090101-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Oren Laadan @ 2010-06-15 2:54 UTC (permalink / raw) To: Serge E. Hallyn; +Cc: Linux Containers, Eric W. Biederman Serge - Is this intended for linux-cr ? Sounds like it should go (or already?) upstream. Oren. On 04/30/2010 02:36 PM, Serge E. Hallyn wrote: > copy_namespaces() cannot be used on a live task. There are two > reasons - it can be used to assign another task's nsproxy, which > is not legal (for a live task). And, it does not use > rcu_assign_pointer, so even when we're being extra-clever it is > unsafe. > > Signed-off-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> > --- > kernel/nsproxy.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c > index f74e6c0..67d8f2b 100644 > --- a/kernel/nsproxy.c > +++ b/kernel/nsproxy.c > @@ -115,6 +115,9 @@ out_ns: > /* > * called from clone. This now handles copy for nsproxy and all > * namespaces therein. > + * Note this should only be used in fork. Specifically, tsk should > + * not yet be a live task. See the the unshare code for how to handle > + * that. > */ > int copy_namespaces(unsigned long flags, struct task_struct *tsk) > { ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <4C16EB55.1090101-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>]
* Re: [PATCH RFC] nsproxy: strengthen the comment above copy_namespaces [not found] ` <4C16EB55.1090101-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> @ 2010-06-15 20:37 ` Serge E. Hallyn 0 siblings, 0 replies; 3+ messages in thread From: Serge E. Hallyn @ 2010-06-15 20:37 UTC (permalink / raw) To: Oren Laadan; +Cc: Linux Containers, Serge E. Hallyn, Eric W. Biederman Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org): > Serge - > > Is this intended for linux-cr ? > Sounds like it should go (or already?) upstream. It was intended for upstream, bit i was fishing for acks/feedback before pushing further. > Oren. > > On 04/30/2010 02:36 PM, Serge E. Hallyn wrote: > > copy_namespaces() cannot be used on a live task. There are two > > reasons - it can be used to assign another task's nsproxy, which > > is not legal (for a live task). And, it does not use > > rcu_assign_pointer, so even when we're being extra-clever it is > > unsafe. > > > > Signed-off-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> > > --- > > kernel/nsproxy.c | 3 +++ > > 1 files changed, 3 insertions(+), 0 deletions(-) > > > > diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c > > index f74e6c0..67d8f2b 100644 > > --- a/kernel/nsproxy.c > > +++ b/kernel/nsproxy.c > > @@ -115,6 +115,9 @@ out_ns: > > /* > > * called from clone. This now handles copy for nsproxy and all > > * namespaces therein. > > + * Note this should only be used in fork. Specifically, tsk should > > + * not yet be a live task. See the the unshare code for how to handle > > + * that. > > */ > > int copy_namespaces(unsigned long flags, struct task_struct *tsk) > > { > _______________________________________________ > Containers mailing list > Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-15 20:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-30 18:36 [PATCH RFC] nsproxy: strengthen the comment above copy_namespaces Serge E. Hallyn
[not found] ` <20100430183638.GA29240-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-06-15 2:54 ` Oren Laadan
[not found] ` <4C16EB55.1090101-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-06-15 20:37 ` Serge E. Hallyn
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox