]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Revert "(namespace) fs: Refuse uid/gid changes which don't map into s_user_ns"
authorLuis Henriques <luis.henriques@canonical.com>
Wed, 23 Nov 2016 10:01:08 +0000 (10:01 +0000)
committerLuis Henriques <luis.henriques@canonical.com>
Wed, 23 Nov 2016 10:14:48 +0000 (10:14 +0000)
BugLink: https://bugs.launchpad.net/bugs/1644165
This reverts commit dc0d66cb531fc0a98c01e292816fb08f16916af8.

The kernel fix for bug #1634964 breaks LXD userspace, in particular the
following commits:

ac7f3f73cb39 (namespace) vfs: Don't modify inodes with a uid or gid unknown to the vfs
ca52383ad6a6 (namespace) vfs: Don't create inodes with a uid or gid unknown to the vfs

LXD 2.0.6 will include changes to support these kernel changes, but it isn't
available yet on xenial, so for now we just revert these commits.

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
fs/attr.c

index 3e75877f74dad94646cca061de11169db472e947..d9f76407c3a5f2d8433f159d16b6b1a9269da650 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -301,17 +301,6 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de
        if (!(attr->ia_valid & ~(ATTR_KILL_SUID | ATTR_KILL_SGID)))
                return 0;
 
-       /*
-        * Verify that uid/gid changes are valid in the target
-        * namespace of the superblock.
-        */
-       if (ia_valid & ATTR_UID &&
-           !kuid_has_mapping(inode->i_sb->s_user_ns, attr->ia_uid))
-               return -EOVERFLOW;
-       if (ia_valid & ATTR_GID &&
-           !kgid_has_mapping(inode->i_sb->s_user_ns, attr->ia_gid))
-               return -EOVERFLOW;
-
        error = security_inode_setattr(dentry, attr);
        if (error)
                return error;