namespace: when DynamicUser=1 is set, mount StateDirectory= bind mounts "nosuid"

Add even more suid/sgid protection to DynamicUser= envionments: the
state directories we bind mount from the host will now have the nosuid
flag set, to disable the effect of nosuid on them.
This commit is contained in:
Lennart Poettering
2019-03-25 19:57:15 +01:00
parent 64e82c1976
commit 9ce4e4b0f6
3 changed files with 34 additions and 17 deletions
+1
View File
@@ -2365,6 +2365,7 @@ static int compile_bind_mounts(
.source = s,
.destination = d,
.read_only = false,
.nosuid = context->dynamic_user, /* don't allow suid/sgid when DynamicUser= is on */
.recursive = true,
.ignore_enoent = false,
};