[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1360681860-29045-2-git-send-email-vgoyal@redhat.com>
Date: Tue, 12 Feb 2013 10:10:59 -0500
From: Vivek Goyal <vgoyal@...hat.com>
To: zohar@...ux.vnet.ibm.com, linux-security-module@...r.kernel.org
Cc: vgoyal@...hat.com, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] ima: detect security xattrs not enabled
vfs_getxattr_alloc() returns -EOPNOTSUPP if filesystem does not have
security label enabled. In that case there is no point in continuing
further and try to fix hashes (if ima_appraise=fix was specified) as
that will fail too. Return early
Signed-off-by: Vivek Goyal <vgoyal@...hat.com>
Acked-by: Mimi Zohar <zohar@...ux.vnet.ibm.com>
---
security/integrity/ima/ima_appraise.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c
index 2d4beca..3710f44 100644
--- a/security/integrity/ima/ima_appraise.c
+++ b/security/integrity/ima/ima_appraise.c
@@ -134,6 +134,10 @@ int ima_appraise_measurement(int func, struct integrity_iint_cache *iint,
rc = vfs_getxattr_alloc(dentry, XATTR_NAME_IMA, (char **)&xattr_value,
0, GFP_NOFS);
if (rc <= 0) {
+ /* File system does not support security xattr */
+ if (rc == -EOPNOTSUPP)
+ return INTEGRITY_UNKNOWN;
+
if (rc && rc != -ENODATA)
goto out;
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists