Merge tag 'integrity-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar...
[linux-block.git] / security / integrity / evm / evm_crypto.c
index 0fe6c9cd8eab41350ed4c113a73e9a0866da3a04..033804f5a5f20daeceb048797e0094a3849d8d45 100644 (file)
@@ -269,7 +269,7 @@ static int evm_calc_hmac_or_hash(struct dentry *dentry,
                                            req_xattr_value_len);
                        continue;
                }
-               size = vfs_getxattr_alloc(&init_user_ns, dentry, xattr->name,
+               size = vfs_getxattr_alloc(&nop_mnt_idmap, dentry, xattr->name,
                                          &xattr_value, xattr_size, GFP_NOFS);
                if (size == -ENOMEM) {
                        error = -ENOMEM;
@@ -278,7 +278,7 @@ static int evm_calc_hmac_or_hash(struct dentry *dentry,
                if (size < 0)
                        continue;
 
-               user_space_size = vfs_getxattr(&init_user_ns, dentry,
+               user_space_size = vfs_getxattr(&nop_mnt_idmap, dentry,
                                               xattr->name, NULL, 0);
                if (user_space_size != size)
                        pr_debug("file %s: xattr %s size mismatch (kernel: %d, user: %d)\n",
@@ -330,7 +330,7 @@ static int evm_is_immutable(struct dentry *dentry, struct inode *inode)
                return 1;
 
        /* Do this the hard way */
-       rc = vfs_getxattr_alloc(&init_user_ns, dentry, XATTR_NAME_EVM,
+       rc = vfs_getxattr_alloc(&nop_mnt_idmap, dentry, XATTR_NAME_EVM,
                                (char **)&xattr_data, 0, GFP_NOFS);
        if (rc <= 0) {
                if (rc == -ENODATA)
@@ -375,12 +375,12 @@ int evm_update_evmxattr(struct dentry *dentry, const char *xattr_name,
                           xattr_value_len, &data);
        if (rc == 0) {
                data.hdr.xattr.sha1.type = EVM_XATTR_HMAC;
-               rc = __vfs_setxattr_noperm(&init_user_ns, dentry,
+               rc = __vfs_setxattr_noperm(&nop_mnt_idmap, dentry,
                                           XATTR_NAME_EVM,
                                           &data.hdr.xattr.data[1],
                                           SHA1_DIGEST_SIZE + 1, 0);
        } else if (rc == -ENODATA && (inode->i_opflags & IOP_XATTR)) {
-               rc = __vfs_removexattr(&init_user_ns, dentry, XATTR_NAME_EVM);
+               rc = __vfs_removexattr(&nop_mnt_idmap, dentry, XATTR_NAME_EVM);
        }
        return rc;
 }