Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217421
b: refs/heads/master
c: bade72d
h: refs/heads/master
i:
  217419: 0317308
v: v3
  • Loading branch information
Eric Paris authored and Linus Torvalds committed Oct 26, 2010
1 parent d307ce2 commit 9e9d74c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 196f518128d2ee6e0028b50e6fec0313640db142
refs/heads/master: bade72d607c4eb1b1d6c7852c493b75f065a56b5
11 changes: 6 additions & 5 deletions trunk/security/integrity/ima/ima_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9e9d74c

Please sign in to comment.