Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / fs / xattr.c
index 4beafc43daa58bff015f0839c78b5a65f8b8d2ab..c243905835abd25b52eb8daf061b5f11b3a5708e 100644 (file)
@@ -38,6 +38,13 @@ xattr_permission(struct inode *inode, const char *name, int mask)
        if (mask & MAY_WRITE) {
                if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
                        return -EPERM;
+               /*
+                * Updating an xattr will likely cause i_uid and i_gid
+                * to be writen back improperly if their true value is
+                * unknown to the vfs.
+                */
+               if (HAS_UNMAPPED_ID(inode))
+                       return -EPERM;
        }
 
        /*