From b893cda7d850e11ebe42b1d7e5d526c60c21bf4d Mon Sep 17 00:00:00 2001 From: Dmitry Kasatkin Date: Thu, 20 Sep 2012 22:38:53 +0300 Subject: [PATCH] --- yaml --- r: 352837 b: refs/heads/master c: def3e8b9ee23cb69036910e48ec4e3eff40e04cb h: refs/heads/master i: 352835: fc1b7304f50961f7525a68fd590842f390d0dea8 v: v3 --- [refs] | 2 +- trunk/security/integrity/ima/ima_appraise.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 9506d9c6f113..dc501b0cd413 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e90805656d4683f84d360276102ae63adc777a38 +refs/heads/master: def3e8b9ee23cb69036910e48ec4e3eff40e04cb diff --git a/trunk/security/integrity/ima/ima_appraise.c b/trunk/security/integrity/ima/ima_appraise.c index bdc8ba1d1d27..b240c58403e2 100644 --- a/trunk/security/integrity/ima/ima_appraise.c +++ b/trunk/security/integrity/ima/ima_appraise.c @@ -42,12 +42,13 @@ int ima_must_appraise(struct inode *inode, int mask, enum ima_hooks func) return ima_match_policy(inode, func, mask, IMA_APPRAISE); } -static void ima_fix_xattr(struct dentry *dentry, +static int ima_fix_xattr(struct dentry *dentry, struct integrity_iint_cache *iint) { iint->ima_xattr.type = IMA_XATTR_DIGEST; - __vfs_setxattr_noperm(dentry, XATTR_NAME_IMA, (u8 *)&iint->ima_xattr, - sizeof iint->ima_xattr, 0); + return __vfs_setxattr_noperm(dentry, XATTR_NAME_IMA, + (u8 *)&iint->ima_xattr, + sizeof(iint->ima_xattr), 0); } /* @@ -141,8 +142,8 @@ int ima_appraise_measurement(struct integrity_iint_cache *iint, if ((ima_appraise & IMA_APPRAISE_FIX) && (!xattr_value || xattr_value->type != EVM_IMA_XATTR_DIGSIG)) { - ima_fix_xattr(dentry, iint); - status = INTEGRITY_PASS; + if (!ima_fix_xattr(dentry, iint)) + status = INTEGRITY_PASS; } integrity_audit_msg(AUDIT_INTEGRITY_DATA, inode, filename, op, cause, rc, 0);