lkml.org 
[lkml]   [2017]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fork.c: Add doc about usage of CLONE_FS flags and namespaces
Date
All other places that deals with namespaces have an explanation of why
the restriction is there. The description added in this commit was based
in e66eded8309eb.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
kernel/fork.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/kernel/fork.c b/kernel/fork.c
index 07cc743698d3..29cb72b64900 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1549,6 +1549,10 @@ static __latent_entropy struct task_struct *copy_process(
int retval;
struct task_struct *p;

+ /*
+ * Don't allow sharing the root directory with processes in a different
+ * namespace
+ */
if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
return ERR_PTR(-EINVAL);

--
2.13.6
\
 
 \ /
  Last update: 2017-11-12 16:19    [W:0.047 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site