Skip to contentSkip to conversation

fork.c: Add doc about usage of CLONE_FS flags and namespaces

PATCH Applied Marcos Paulo de Souza 1 participant 1 message Nov 12, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fork.c: Add doc about usage of CLONE_FS flags and namespaces

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.

---
 kernel/fork.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/fork.c +4 -0
index 07cc743698d3..29cb72b64900 100644
@@ -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);
 
Signature · 1 line
2.13.6