moby--moby/volume/local
Brian Goff 7f5e39bd4f
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)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-02 13:01:25 +01:00
..
local.go Use real root with 0701 perms 2021-02-02 13:01:25 +01:00
local_linux_test.go volume/local: add tests for size quota 2020-10-05 13:28:25 +00:00
local_test.go vendor: moby/sys mountinfo/v0.4.0 2020-10-29 23:02:28 +01:00
local_unix.go volumes/local: gofmt 2021-01-14 14:54:37 +01:00
local_windows.go Do not call mount.RecursiveUnmount() on Windows 2020-10-29 23:00:16 +01:00