[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240307122240.3560688-1-roberto.sassu@huaweicloud.com>
Date: Thu, 7 Mar 2024 13:22:39 +0100
From: Roberto Sassu <roberto.sassu@...weicloud.com>
To: zohar@...ux.ibm.com,
dmitry.kasatkin@...il.com,
eric.snowberg@...cle.com,
paul@...l-moore.com,
jmorris@...ei.org,
serge@...lyn.com
Cc: linux-integrity@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org,
Roberto Sassu <roberto.sassu@...wei.com>,
stable@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
Christian Brauner <brauner@...nel.org>,
Seth Forshee <sforshee@...nel.org>
Subject: [PATCH] evm: Change vfs_getxattr() with __vfs_getxattr() in evm_calc_hmac_or_hash()
From: Roberto Sassu <roberto.sassu@...wei.com>
Use __vfs_getxattr() instead of vfs_getxattr(), in preparation for
deprecating using the vfs_ interfaces for retrieving fscaps.
__vfs_getxattr() is only used for debugging purposes, to check if kernel
space and user space see the same xattr value.
Cc: stable@...r.kernel.org # 5.14.x
Cc: linux-fsdevel@...r.kernel.org
Cc: Christian Brauner <brauner@...nel.org>
Cc: Seth Forshee (DigitalOcean) <sforshee@...nel.org>
Fixes: 907a399de7b0 ("evm: Check xattr size discrepancy between kernel and user")
Signed-off-by: Roberto Sassu <roberto.sassu@...wei.com>
---
security/integrity/evm/evm_crypto.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
index b1ffd4cc0b44..168d98c63513 100644
--- a/security/integrity/evm/evm_crypto.c
+++ b/security/integrity/evm/evm_crypto.c
@@ -278,8 +278,8 @@ static int evm_calc_hmac_or_hash(struct dentry *dentry,
if (size < 0)
continue;
- user_space_size = vfs_getxattr(&nop_mnt_idmap, dentry,
- xattr->name, NULL, 0);
+ user_space_size = __vfs_getxattr(dentry, inode, xattr->name,
+ NULL, 0);
if (user_space_size != size)
pr_debug("file %s: xattr %s size mismatch (kernel: %d, user: %d)\n",
dentry->d_name.name, xattr->name, size,
--
2.34.1
Powered by blists - more mailing lists