Skip to contentSkip to conversation

kernel/fork.c: add comment about usage of CLONE_FS flags and namespaces

PATCH New [email protected] 1 participant 1 message Feb 6, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 61/114 kernel/fork.c: add comment about usage of CLONE_FS flags and namespaces

From: Marcos Paulo de Souza <[email protected]>
Subject: kernel/fork.c: add comment 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 on e66eded8309eb ("userns: Don't allow CLONE_NEWUSER | CLONE_FS").

---

 kernel/fork.c |    4 ++++
 1 file changed, 4 insertions(+)
kernel/fork.c renamed from kernel/fork.c~forkc-add-doc-about-usage-of-clone_fs-flags-and-namespaces +4 -0
diff -puN kernel/fork.c~forkc-add-doc-about-usage-of-clone_fs-flags-and-namespaces kernel/fork.c
@@ -1587,6 +1587,10 @@ static __latent_entropy struct task_stru
 	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);
 

_