nspawn: don't hide --bind=/tmp/* mounts#4824
Conversation
@zonque , please take a look. |
src/nspawn/nspawn-mount.c
Outdated
| { "/proc/sysrq-trigger", "/proc/sysrq-trigger", NULL, NULL, MS_BIND, MOUNT_IN_USERNS|MOUNT_APPLY_APIVFS_RO }, /* Bind mount first ...*/ | ||
| { NULL, "/proc/sysrq-trigger", NULL, NULL, MS_BIND|MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REMOUNT, MOUNT_IN_USERNS|MOUNT_APPLY_APIVFS_RO }, /* ... then, make it r/o */ | ||
| { "tmpfs", "/tmp", "tmpfs", "mode=1777", MS_STRICTATIME, MOUNT_FATAL|MOUNT_IN_USERNS }, | ||
| { "tmpfs", "/tmp", "tmpfs", "mode=1777", MS_STRICTATIME, MOUNT_FATAL }, |
There was a problem hiding this comment.
I should move this line to the "outer child"-part. Will fix
|
Fedora test is broken, rest is okay. |
|
@systemd-centos-ci |
|
All looks good. merging. @evverx i wonder though whether we can find a fix for the problem you tried to fix with 8492849? I mean, there was a good reason to make that change after all. I wonder if there's a nice way to detect "foreign" mounts, so that PID 1 in the container could exclude them from umount.target Conflicts= lines. Or alternatively, we could add some logic that makes /tmp a user mount only when it is safe. I.e. basicely reuse your suggested logic, but conditionalize it on the whether there are any mounts configured with /tmp as prefix? |
I think the only reliable way is to ask |
I wonder if /proc/self/mountinfo in some way let's us know this... |
|
Hm, that's a good question. I didn't think about it. |
backport: nspawn: don't hide --bind=/tmp/* mounts (systemd#4824)
Fixes #4789