Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217412
b: refs/heads/master
c: b575156
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris authored and Linus Torvalds committed Oct 26, 2010
1 parent 0f8401e commit b665070
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 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: 8549164143a5431f9d9ea846acaa35a862410d9c
refs/heads/master: b575156dafef208415ff0842c392733d16d4ccf1
1 change: 0 additions & 1 deletion trunk/security/integrity/ima/ima.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ struct ima_iint_cache {
struct mutex mutex; /* protects: version, flags, digest */
long readcount; /* measured files readcount */
long writecount; /* measured files writecount */
long opencount; /* opens reference count */
struct kref refcount; /* ima_iint_cache reference count */
};

Expand Down
6 changes: 0 additions & 6 deletions trunk/security/integrity/ima/ima_iint.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ void iint_free(struct kref *kref)
iint->writecount);
iint->writecount = 0;
}
if (iint->opencount != 0) {
printk(KERN_INFO "%s: opencount: %ld\n", __func__,
iint->opencount);
iint->opencount = 0;
}
kref_init(&iint->refcount);
kmem_cache_free(iint_cache, iint);
}
Expand Down Expand Up @@ -172,7 +167,6 @@ static void init_once(void *foo)
mutex_init(&iint->mutex);
iint->readcount = 0;
iint->writecount = 0;
iint->opencount = 0;
kref_init(&iint->refcount);
}

Expand Down
10 changes: 3 additions & 7 deletions trunk/security/integrity/ima/ima_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand All @@ -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();
}
}
Expand Down

0 comments on commit b665070

Please sign in to comment.