]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit - fs/Kconfig
UBUNTU: SAUCE: shiftfs: uid/gid shifting bind mount
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 4 Apr 2019 13:39:11 +0000 (15:39 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 25 Nov 2019 13:56:39 +0000 (14:56 +0100)
commit8ef17b62e5fb717c60c2fb7d431728945b87b9fc
treec6503240885ec5aa003603ae76145f7bfb3dabef
parentf54a65f1ea38f66c8343a1df8a8999ce711c2372
UBUNTU: SAUCE: shiftfs: uid/gid shifting bind mount

BugLink: https://bugs.launchpad.net/bugs/1823186
This allows any subtree to be uid/gid shifted and bound elsewhere.  It
does this by operating simlarly to overlayfs.  Its primary use is for
shifting the underlying uids of filesystems used to support
unpriviliged (uid shifted) containers.  The usual use case here is
that the container is operating with an uid shifted unprivileged root
but sometimes needs to make use of or work with a filesystem image
that has root at real uid 0.

The mechanism is to allow any subordinate mount namespace to mount a
shiftfs filesystem (by marking it FS_USERNS_MOUNT) but only allowing
it to mount marked subtrees (using the -o mark option as root).  Once
mounted, the subtree is mapped via the super block user namespace so
that the interior ids of the mounting user namespace are the ids
written to the filesystem.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
[ saf: use designated initializers for path declarations to fix errors
  with struct randomization ]
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
[update: port to 5.0]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/Kconfig
fs/Makefile
fs/shiftfs.c [new file with mode: 0644]
include/uapi/linux/magic.h