[PATCH] unshare.2: note EINVAL when unsharing pid ns twice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The kernel doesn't allow unsharing a pid NS if it has previously been
unshared, per this check in copy_pid_ns:

        if (task_active_pid_ns(current) != old_ns)
                return ERR_PTR(-EINVAL);

so let's note that.

Signed-off-by: Tycho Andersen <tycho@xxxxxxxx>
---
 man2/unshare.2 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man2/unshare.2 b/man2/unshare.2
index 5206eba6b..a24a627d8 100644
--- a/man2/unshare.2
+++ b/man2/unshare.2
@@ -330,6 +330,14 @@ but the kernel was not configured with the
 .B CONFIG_UTS_NS
 option.
 .TP
+.B EINVAL
+.BR CLONE_NEWPID
+was specified in
+.IR flags
+but there was a previous
+.BR unshare(CLONE_NEWPID)
+call.
+.TP
 .B ENOMEM
 Cannot allocate sufficient memory to copy parts of caller's
 context that need to be unshared.
-- 
2.17.1




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux