clone.2, unshare.2: Exceeding the maximum nested user namespace limit now gives ENOSPC

Formerly, if the limit of 32 nested user namespaces was exceeded,
the error EUSERS resulted. Starting with Linux 4.9, the error
is ENOSPC.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-04-17 13:46:02 +02:00
parent b20e22aeb7
commit b5742eccf1
2 changed files with 33 additions and 9 deletions

View File

@ -1068,6 +1068,18 @@ but the limit on the nesting depth of PID namespaces
would have been exceeded; see
.BR pid_namespaces (7).
.TP
.BR ENOSPC " (since Linux 4.9; beforehand " EUSERS )
.B CLONE_NEWUSER
was specified in
.IR flags ,
and the call would cause the limit on the number of
nested user namespaces to be exceeded.
See
.BR user_namespaces (7).
From Linux 3.11 to Linux 4.8, the error diagnosed in this case was
.BR EUSERS .
.TP
.B EPERM
.BR CLONE_NEWCGROUP ,
.BR CLONE_NEWIPC ,
@ -1105,14 +1117,14 @@ of the mount namespace in which it resides).
System call was interrupted by a signal and will be restarted.
(This can be seen only during a trace.)
.TP
.BR EUSERS " (since Linux 3.11)"
.BR EUSERS " (Linux 3.11 to Linux 4.8)"
.B CLONE_NEWUSER
was specified in
.IR flags ,
and the call would cause the limit on the number of
nested user namespaces to be exceeded.
See
.BR user_namespaces (7).
and the limit on the number of nested user namespaces would be exceeded.
See the discussion of the
.BR ENOSPC
error above.
.\" .SH VERSIONS
.\" There is no entry for
.\" .BR clone ()

View File

@ -300,6 +300,18 @@ but the limit on the nesting depth of PID namespaces
would have been exceeded; see
.BR pid_namespaces (7).
.TP
.BR ENOSPC " (since Linux 4.9; beforehand " EUSERS )
.B CLONE_NEWUSER
was specified in
.IR flags ,
and the call would cause the limit on the number of
nested user namespaces to be exceeded.
See
.BR user_namespaces (7).
From Linux 3.11 to Linux 4.8, the error diagnosed in this case was
.BR EUSERS .
.TP
.B EPERM
The calling process did not have the required privileges for this operation.
.TP
@ -325,10 +337,10 @@ of the mount namespace in which it resides).
.B CLONE_NEWUSER
was specified in
.IR flags ,
and the call would cause the limit on the number of
nested user namespaces to be exceeded.
See
.BR user_namespaces (7).
and the limit on the number of nested user namespaces would be exceeded.
See the discussion of the
.BR ENOSPC
error above.
.SH VERSIONS
The
.BR unshare ()