]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
UBUNTU: SAUCE: ext4: Add support for unprivileged mounts from user namespaces
authorSeth Forshee <seth.forshee@canonical.com>
Sat, 18 Oct 2014 11:02:09 +0000 (13:02 +0200)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:19:11 +0000 (10:19 +0100)
commit7a5ab85b4d1a10ed7261952b6e89a887ce15d925
tree9bb9580a661b9ce25bb36f7988f42ce503922e3d
parent4de0a612f0406c4c92a1cdc9e2e698fd5bfab249
UBUNTU: SAUCE: ext4: Add support for unprivileged mounts from user namespaces

Support unprivileged mounting of ext4 volumes from user
namespaces. This requires the following changes:

 - Perform all uid and gid conversions to/from disk relative to
   s_user_ns. In many cases this will already be handled by the
   vfs helper functions. This also requires updates to handle
   cases where ids may not map into s_user_ns.

 - Update most capability checks to check for capabilities in
   s_user_ns rather than init_user_ns. These mostly reflect
   changes to the filesystem that a user in s_user_ns could
   already make externally by virtue of having write access to
   the backing device.

 - Restrict unsafe options in either the mount options or the
   ext4 superblock. Currently the only concerning option is
   errors=panic, and this is made to require CAP_SYS_ADMIN in
   init_user_ns.

 - Verify that unprivileged users have the required access to the
   journal device at the path passed via the journal_path mount
   option.

   Note that for the journal_path and the journal_dev mount
   options, and for external journal devices specified in the
   ext4 superblock, devcgroup restrictions will be enforced by
   __blkdev_get(), (via blkdev_get_by_dev()), ensuring that the
   user has been granted appropriate access to the block device.

 - Set the FS_USERNS_MOUNT flag on the filesystem types supported
   by ext4.

sysfs attributes for ext4 mounts remain writable only by real
root.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/ext4/acl.c
fs/ext4/balloc.c
fs/ext4/ialloc.c
fs/ext4/ioctl.c
fs/ext4/resize.c
fs/ext4/super.c