Skip to contentSkip to conversation

CacheFiles: Update IMA counters when using dentry_open

PATCH New David Howells 1 participant 1 message Dec 1, 2009 Cachefiles: fs-cache backend for caching on mounted filesystems

lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 1/1 CacheFiles: Update IMA counters when using dentry_open

From: Marc Dionne <[email protected]>

When IMA is active, using dentry_open without updating the IMA counters will result in free/open imbalance errors when fput is eventually called.

---

 fs/cachefiles/rdwr.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/cachefiles/rdwr.c +2 -0
index 1d83325..a6c8c6f 100644
@@ -11,6 +11,7 @@
 
 #include <linux/mount.h>
 #include <linux/file.h>
+#include <linux/ima.h>
 #include "internal.h"
 
 /*
@@ -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;