@@ -41,12 +41,6 @@ enum sync_t {
4141 SYNC_CHILD_FINISH = 0x45 , /* The child or grandchild has finished. */
4242};
4343
44- /*
45- * Synchronisation value for cgroup namespace setup.
46- * The same constant is defined in process_linux.go as "createCgroupns".
47- */
48- #define CREATECGROUPNS 0x80
49-
5044#define STAGE_SETUP -1
5145/* longjmp() arguments. */
5246#define STAGE_PARENT 0
@@ -1075,24 +1069,9 @@ void nsexec(void)
10751069 bail ("setgroups failed" );
10761070 }
10771071
1078- /*
1079- * Wait until our topmost parent has finished cgroup setup in
1080- * p.manager.Apply().
1081- *
1082- * TODO(cyphar): Check if this code is actually needed because we
1083- * should be in the cgroup even from stage-0, so
1084- * waiting until now might not make sense.
1085- */
10861072 if (config .cloneflags & CLONE_NEWCGROUP ) {
1087- uint8_t value ;
1088- if (read (pipenum , & value , sizeof (value )) != sizeof (value ))
1089- bail ("read synchronisation value failed" );
1090- if (value == CREATECGROUPNS ) {
1091- write_log (DEBUG , "unshare cgroup namespace" );
1092- if (unshare (CLONE_NEWCGROUP ) < 0 )
1093- bail ("failed to unshare cgroup namespace" );
1094- } else
1095- bail ("received unknown synchronisation value" );
1073+ if (unshare (CLONE_NEWCGROUP ) < 0 )
1074+ bail ("failed to unshare cgroup namespace" );
10961075 }
10971076
10981077 write_log (DEBUG , "signal completion to stage-0" );
0 commit comments