core/namespace: stop applying mount options on private cgroupfs mount

We always unshare cgroup ns for ProtectControlGroups=private/strict,
while the mount options only apply to the cgroupfs instance
in initial cgns (c.f.
https://github.com/torvalds/linux/blob/b69bb476dee99d564d65d418e9a20acca6f32c3f/kernel/cgroup/cgroup.c#L1984)
Hence let's drop the thing wholesale.

Also, as noted in the comment already, mount_private_apivfs()
internally enforces nosuid/noexec, so drop explicit flags too.
This commit is contained in:
Mike Yuan
2025-03-30 18:57:18 +02:00
parent 32b69b190b
commit 1614d0c451
3 changed files with 6 additions and 18 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ typedef struct MountPoint {
MountMode mode;
} MountPoint;
bool cgroupfs_recursiveprot_supported(void) {
static bool cgroupfs_recursiveprot_supported(void) {
int r;
/* Added in kernel 5.7 */
-2
View File
@@ -8,5 +8,3 @@ bool mount_point_ignore(const char *path);
int mount_setup_early(void);
int mount_setup(bool loaded_policy, bool leave_propagation);
bool cgroupfs_recursiveprot_supported(void);