1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/graphdriver
Brian Goff 67de83e70b Use real root with 0701 perms
Various dirs in /var/lib/docker contain data that needs to be mounted
into a container. For this reason, these dirs are set to be owned by the
remapped root user, otherwise there can be permissions issues.
However, this uneccessarily exposes these dirs to an unprivileged user
on the host.

Instead, set the ownership of these dirs to the real root (or rather the
UID/GID of dockerd) with 0701 permissions, which allows the remapped
root to enter the directories but not read/write to them.
The remapped root needs to enter these dirs so the container's rootfs
can be configured... e.g. to mount /etc/resolve.conf.

This prevents an unprivileged user from having read/write access to
these dirs on the host.
The flip side of this is now any user can enter these directories.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e908cc3901)

Cherry-pick conflict with eb14d936bf:
Kept old `container` variable name.
Signed-off-by: Tibor Vass <tibor@docker.com>
2021-01-28 21:42:41 +00:00
..
aufs Use real root with 0701 perms 2021-01-28 21:42:41 +00:00
btrfs Use real root with 0701 perms 2021-01-28 21:42:41 +00:00
copy cast Dev and Rdev of Stat_t to uint64 for mips 2020-01-13 09:25:13 +08:00
devmapper Use fewer modprobes 2020-02-06 13:18:23 +09:00
graphtest Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
lcow LCOW: Add SIDs to layer.vhd at creation 2019-03-21 13:12:17 -07:00
overlay Use real root with 0701 perms 2021-01-28 21:42:41 +00:00
overlay2 Use real root with 0701 perms 2021-01-28 21:42:41 +00:00
overlayutils Fix/improve overlay support check 2020-02-06 13:18:41 +09:00
quota projectquota: protect concurrent map access 2019-08-06 12:06:08 -07:00
register Add canonical import comment 2018-02-05 16:51:57 -05:00
vfs Use real root with 0701 perms 2021-01-28 21:42:41 +00:00
windows Windows: Don't attempt detach VHD for R/O layers 2019-06-05 14:45:56 +02:00
zfs Use real root with 0701 perms 2021-01-28 21:42:41 +00:00
counter.go graphdriver: Fix RefCounter memory leak 2018-02-09 10:26:06 +08:00
driver.go Deprecate AuFS storage driver, and add warning 2018-10-26 18:41:46 +02:00
driver_freebsd.go Add canonical import comment 2018-02-05 16:51:57 -05:00
driver_linux.go Add canonical import comment 2018-02-05 16:51:57 -05:00
driver_test.go Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
driver_unsupported.go Add canonical import comment 2018-02-05 16:51:57 -05:00
driver_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
errors.go Add canonical import comment 2018-02-05 16:51:57 -05:00
fsdiff.go Add layer id to NaiveDiffDriver untar timing log 2018-10-05 16:28:40 -07:00
plugin.go Move plugin client to separate interface 2018-05-30 15:22:10 -04:00
proxy.go Move plugin client creation to the extension point 2018-05-25 15:18:53 -04:00