From 1f1c28e0a9d0cc4c85c8d5c4d9a28cd3276656e0 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sat, 28 Jul 2018 20:44:56 +0200 Subject: [PATCH] unshare.2: Same EINVAL errors as for clone(2) can also occur with unshare(2) The EINVAL errors that can occur for clone(2) when it is called with various CLONE_NEW* flags and the kernel was not configured with support for the corresponding namespace can also occur for unshare(2). (As far as I can see, these errors don't occur for either clone(2) or unshare(2) when it comes to CLONE_NEWNS and CLONE_NEWCGROUP.) Reported-by: Shawn Landden Signed-off-by: Michael Kerrisk --- man2/unshare.2 | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/man2/unshare.2 b/man2/unshare.2 index f0a0f0ec5..5206eba6b 100644 --- a/man2/unshare.2 +++ b/man2/unshare.2 @@ -288,6 +288,48 @@ was specified in .IR flags , and the caller is multithreaded. .TP +.B EINVAL +.BR CLONE_NEWIPC +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_SYSVIPC +and +.BR CONFIG_IPC_NS +options. +.TP +.B EINVAL +.BR CLONE_NEWNET +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_NET_NS +option. +.TP +.B EINVAL +.BR CLONE_NEWPID +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_PID_NS +option. +.TP +.B EINVAL +.BR CLONE_NEWUSER +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_USER_NS +option. +.TP +.B EINVAL +.BR CLONE_NEWUTS +was specified in +.IR flags , +but the kernel was not configured with the +.B CONFIG_UTS_NS +option. +.TP .B ENOMEM Cannot allocate sufficient memory to copy parts of caller's context that need to be unshared.