From 9e9d74c6936a6c858c2c9f8be2897624bacbcd31 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Mon, 25 Oct 2010 14:42:25 -0400 Subject: [PATCH] --- yaml --- r: 217421 b: refs/heads/master c: bade72d607c4eb1b1d6c7852c493b75f065a56b5 h: refs/heads/master i: 217419: 03173089cef4a799af8b19d97b14d5565b8d1137 v: v3 --- [refs] | 2 +- trunk/security/integrity/ima/ima_main.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f722ca42cf2e..c953d955f269 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 196f518128d2ee6e0028b50e6fec0313640db142 +refs/heads/master: bade72d607c4eb1b1d6c7852c493b75f065a56b5 diff --git a/trunk/security/integrity/ima/ima_main.c b/trunk/security/integrity/ima/ima_main.c index 60dd61527b1e..203de979d305 100644 --- a/trunk/security/integrity/ima/ima_main.c +++ b/trunk/security/integrity/ima/ima_main.c @@ -112,22 +112,23 @@ void ima_counts_get(struct file *file) if (!ima_initialized) goto out; - rc = ima_must_measure(NULL, inode, MAY_READ, FILE_CHECK); - if (rc < 0) - goto out; - if (mode & FMODE_WRITE) { - if (inode->i_readcount) + if (inode->i_readcount && IS_IMA(inode)) send_tomtou = true; goto out; } + rc = ima_must_measure(NULL, inode, MAY_READ, FILE_CHECK); + if (rc < 0) + goto out; + if (atomic_read(&inode->i_writecount) > 0) send_writers = true; out: /* remember the vfs deals with i_writecount */ if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) inode->i_readcount++; + spin_unlock(&inode->i_lock); if (send_tomtou)