Thread (18 messages) 18 messages, 2 authors, 2021-09-13

Re: [PATCH 09/15] clone.2: ERRORS: Add EACCESS with CLONE_INTO_CGROUP + clone3

From: Alejandro Colomar (man-pages) <hidden>
Date: 2021-09-10 22:53:21

Hi Michael,

On 9/11/21 12:47 AM, Alejandro Colomar wrote:
[Andrew]:
I noticed that clone3 can send the EACCES errno after I wrote a
program that used clone3 with the CLONE_INTO_CGROUP flag.
To me, it's important to know what kind of failure occurred if the
clone3() fails, so I was glad that a unique errno is set for
this case, but it wasn't documented on the clone man page.

[Christian]:
In essence, any error that could occur during regular fs-based migration
at write-time can also occur during CLONE_INTO_CGROUP. The clone3()
manpage just has the inverse of that above statement:

"Note that all of the usual restrictions (described in cgroups(7)) on
placing a process into a version 2 cgroup apply."

Reported-by: Andrew Wock <redacted>
Acked-by: Christian Brauner <redacted>
Signed-off-by: Alejandro Colomar <redacted>
I forgot to fix the author of the commit.  It should be Andrew, as he 
provided the diff, eventhough I commited it.

Please fix that.

Thanks,

Alex
quoted hunk ↗ jump to hunk
---
  man2/clone.2 | 10 ++++++++++
  1 file changed, 10 insertions(+)
diff --git a/man2/clone.2 b/man2/clone.2
index e381da165..90db92ad6 100644
--- a/man2/clone.2
+++ b/man2/clone.2
@@ -1209,6 +1209,16 @@ in the caller's context, no child process is created, and
  is set to indicate the error.
  .SH ERRORS
  .TP
+.BR EACCES " (" clone3 "() only)"
+.B CLONE_INTO_CGROUP
+was specified in
+.IR cl_args.flags ,
+but the restrictions (described in
+.BR cgroups (7))
+on placing the child process into the version 2 cgroup referred to by
+.I cl_args.cgroup
+are not met.
+.TP
  .B EAGAIN
  Too many processes are already running; see
  .BR fork (2).

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help