summaryrefslogtreecommitdiffstats
path: root/security/integrity/ima/ima_main.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2010-10-25 20:41:26 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 20:37:17 +0200
commitb575156dafef208415ff0842c392733d16d4ccf1 (patch)
tree52e4afd6a1969a975bd9e4b882d97d5ab659fa20 /security/integrity/ima/ima_main.c
parentIMA: use rbtree instead of radix tree for inode information cache (diff)
downloadlinux-b575156dafef208415ff0842c392733d16d4ccf1.tar.xz
linux-b575156dafef208415ff0842c392733d16d4ccf1.zip
IMA: drop the inode opencount since it isn't needed for operation
The opencount was used to help debugging to make sure that everything which created a struct file also correctly made the IMA calls. Since we moved all of that into the VFS this isn't as necessary. We should be able to get the same amount of debugging out of just the reader and write count. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/integrity/ima/ima_main.c')
-rw-r--r--security/integrity/ima/ima_main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index e662b89d4079..995bd1b98fa8 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -122,7 +122,6 @@ static void ima_inc_counts(struct ima_iint_cache *iint, fmode_t mode)
{
BUG_ON(!mutex_is_locked(&iint->mutex));
- iint->opencount++;
if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
iint->readcount++;
if (mode & FMODE_WRITE)
@@ -181,7 +180,6 @@ static void ima_dec_counts(struct ima_iint_cache *iint, struct inode *inode,
mode_t mode = file->f_mode;
BUG_ON(!mutex_is_locked(&iint->mutex));
- iint->opencount--;
if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
iint->readcount--;
if (mode & FMODE_WRITE) {
@@ -192,13 +190,11 @@ static void ima_dec_counts(struct ima_iint_cache *iint, struct inode *inode,
}
}
- if (((iint->opencount < 0) ||
- (iint->readcount < 0) ||
+ if (((iint->readcount < 0) ||
(iint->writecount < 0)) &&
!ima_limit_imbalance(file)) {
- printk(KERN_INFO "%s: open/free imbalance (r:%ld w:%ld o:%ld)\n",
- __func__, iint->readcount, iint->writecount,
- iint->opencount);
+ printk(KERN_INFO "%s: open/free imbalance (r:%ld w:%ld)\n",
+ __func__, iint->readcount, iint->writecount);
dump_stack();
}
}