Skip to contentSkip to conversation

man/man2/clone.2: Document CLONE_NEWPID and CLONE_NEWUSER flag

PATCH In review devhoodit 2 participants 4 messages Apr 20, 2025 – Nov 12, 2025

Subsystems (2)
lore
Share & tools
lore

devhoodit

author
#0 lore raw

PATCH 1/1 man/man2/clone.2: Document CLONE_NEWPID and CLONE_NEWUSER flag

CLONE_NEWPID and CLONE_PARENT can be used together, but not CLONE_THREAD. Similarly, CLONE_NEWUSER and CLONE_PARENT can be used together, but not CLONE_THREAD. This was discussed here: <https://lore.kernel.org/linux-man/[email protected]/T/>
Relevant code: <https://github.com/torvalds/linux/blob/219d54332a09e8d8741c1e1982f5eae56099de85/kernel/fork.c#L1815>

Cc Carlos O'Donell <[email protected]>
Cc Andrew Morton <[email protected]>
---
 man/man2/clone.2 | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
man/man2/clone.2 +3 -6
index 1b74e4c92..b9561125a 100644
@@ -776,9 +776,7 @@ .SS The flags mask
 no privileges are needed to create a user namespace.
 .IP
 This flag can't be specified in conjunction with
-.B CLONE_THREAD
-or
-.BR CLONE_PARENT .
+.BR CLONE_THREAD .
 For security reasons,
 .\" commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
 .\" https://lwn.net/Articles/543273/
@@ -1319,11 +1317,10 @@ .SH ERRORS
 mask.
 .TP
 .B EINVAL
+Both
 .B CLONE_NEWPID
-and one (or both) of
+and
 .B CLONE_THREAD
-or
-.B CLONE_PARENT
 were specified in the
 .I flags
 mask.
Signature · 1 line
2.49.0
#1 lore raw

Hi Carlos,

Quoted 7 lines · devhoodit

CLONE_NEWPID and CLONE_PARENT can be used together, but not CLONE_THREAD. Similarly, CLONE_NEWUSER and CLONE_PARENT can be used together, but not CLONE_THREAD. This was discussed here: <https://lore.kernel.org/linux-man/[email protected]/T/>
Relevant code: <https://github.com/torvalds/linux/blob/219d54332a09e8d8741c1e1982f5eae56099de85/kernel/fork.c#L1815>

Cc Carlos O'Donell <[email protected]>
Cc Andrew Morton <[email protected]>

Could you please review this patch?

Have a lovely night!
Alex

Quoted 36 lines
---
 man/man2/clone.2 | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
man/man2/clone.2 +3 -6
index 1b74e4c92..b9561125a 100644
@@ -776,9 +776,7 @@ .SS The flags mask
 no privileges are needed to create a user namespace.
 .IP
 This flag can't be specified in conjunction with
-.B CLONE_THREAD
-or
-.BR CLONE_PARENT .
+.BR CLONE_THREAD .
 For security reasons,
 .\" commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
 .\" https://lwn.net/Articles/543273/
@@ -1319,11 +1317,10 @@ .SH ERRORS
 mask.
 .TP
 .B EINVAL
+Both
 .B CLONE_NEWPID
-and one (or both) of
+and
 .B CLONE_THREAD
-or
-.B CLONE_PARENT
 were specified in the
 .I flags
 mask.
Signature · 1 line
2.49.0
Signature · 1 line
<https://www.alejandro-colomar.es/>
author
#2 lore raw

Hi, Alejandro Colomar and Carlos

Just a friendly ping to check if you had a chance to review this patch.

Thanks

2025년 5월 2일 (금) 오전 6:30, Alejandro Colomar <[email protected]>님이 작성:

Quoted 57 lines

Hi Carlos,

Quoted 7 lines · devhoodit

CLONE_NEWPID and CLONE_PARENT can be used together, but not CLONE_THREAD. Similarly, CLONE_NEWUSER and CLONE_PARENT can be used together, but not CLONE_THREAD. This was discussed here: <https://lore.kernel.org/linux-man/[email protected]/T/>
Relevant code: <https://github.com/torvalds/linux/blob/219d54332a09e8d8741c1e1982f5eae56099de85/kernel/fork.c#L1815>

Cc Carlos O'Donell <[email protected]>
Cc Andrew Morton <[email protected]>

Could you please review this patch?

Have a lovely night!
Alex

Quoted 34 lines
---
 man/man2/clone.2 | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
man/man2/clone.2 +3 -7
index 1b74e4c92..b9561125a 100644
@@ -776,9 +776,7 @@ .SS The flags mask
 no privileges are needed to create a user namespace.
 .IP
 This flag can't be specified in conjunction with
-.B CLONE_THREAD
-or
-.BR CLONE_PARENT .
+.BR CLONE_THREAD .
 For security reasons,
 .\" commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
 .\" https://lwn.net/Articles/543273/
@@ -1319,11 +1317,10 @@ .SH ERRORS
 mask.
 .TP
 .B EINVAL
+Both
 .B CLONE_NEWPID
-and one (or both) of
+and
 .B CLONE_THREAD
-or
-.B CLONE_PARENT
 were specified in the
 .I flags
 mask.
--
Quoted 2 lines

2.49.0

--
<https://www.alejandro-colomar.es/>

#3 lore raw

Hi,

Quoted 3 lines · hoodit dev

Hi, Alejandro Colomar and Carlos

Just a friendly ping to check if you had a chance to review this patch.

I don't know enough of clone(2) to review this. I'll wait for Carlos's review.

Have a lovely day!
Alex

Quoted 62 lines

Thanks

2025년 5월 2일 (금) 오전 6:30, Alejandro Colomar <[email protected]>님이 작성:

Quoted 57 lines

Hi Carlos,

Quoted 7 lines · devhoodit

CLONE_NEWPID and CLONE_PARENT can be used together, but not CLONE_THREAD. Similarly, CLONE_NEWUSER and CLONE_PARENT can be used together, but not CLONE_THREAD. This was discussed here: <https://lore.kernel.org/linux-man/[email protected]/T/>
Relevant code: <https://github.com/torvalds/linux/blob/219d54332a09e8d8741c1e1982f5eae56099de85/kernel/fork.c#L1815>

Cc Carlos O'Donell <[email protected]>
Cc Andrew Morton <[email protected]>

Could you please review this patch?

Have a lovely night!
Alex

Quoted 34 lines
---
 man/man2/clone.2 | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
man/man2/clone.2 +3 -7
index 1b74e4c92..b9561125a 100644
@@ -776,9 +776,7 @@ .SS The flags mask
 no privileges are needed to create a user namespace.
 .IP
 This flag can't be specified in conjunction with
-.B CLONE_THREAD
-or
-.BR CLONE_PARENT .
+.BR CLONE_THREAD .
 For security reasons,
 .\" commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
 .\" https://lwn.net/Articles/543273/
@@ -1319,11 +1317,10 @@ .SH ERRORS
 mask.
 .TP
 .B EINVAL
+Both
 .B CLONE_NEWPID
-and one (or both) of
+and
 .B CLONE_THREAD
-or
-.B CLONE_PARENT
 were specified in the
 .I flags
 mask.
--
Quoted 2 lines

2.49.0

--
<https://www.alejandro-colomar.es/>

Signature · 2 lines
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).