Skip to content

Commit

Permalink
CacheFiles: Update IMA counters when using dentry_open
Browse files Browse the repository at this point in the history
When IMA is active, using dentry_open without updating the
IMA counters will result in free/open imbalance errors when
fput is eventually called.

Signed-off-by: Marc Dionne <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mdionne authored and torvalds committed Dec 1, 2009
1 parent fa1dae4 commit 3350b2a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/cachefiles/rdwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <linux/mount.h>
#include <linux/file.h>
#include <linux/ima.h>
#include "internal.h"

/*
Expand Down Expand Up @@ -922,6 +923,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
if (IS_ERR(file)) {
ret = PTR_ERR(file);
} else {
ima_counts_get(file);
ret = -EIO;
if (file->f_op->write) {
pos = (loff_t) page->index << PAGE_SHIFT;
Expand Down

0 comments on commit 3350b2a

Please sign in to comment.