[Devel] [PATCH RHEL7 COMMIT] Revert "ms/fs: Refuse uid/gid changes which don't map into s_user_ns"

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jul 21 11:00:36 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.33.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.33.12
------>
commit 6fb7d1a831e85dda7c680e76b2c9b36487e944d1
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Fri Jul 21 11:57:34 2017 +0400

    Revert "ms/fs: Refuse uid/gid changes which don't map into s_user_ns"
    
    This reverts commit 55e19a01e152894b6dce5cc7f5d6d0db607c1314.
    
    Temporary revert due to
    https://jira.sw.ru/browse/PSBM-68599
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/attr.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/fs/attr.c b/fs/attr.c
index 00dc159..7262f3b 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -260,17 +260,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;


More information about the Devel mailing list