public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CacheFiles: Update IMA counters when using dentry_open
@ 2009-12-01 14:09 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2009-12-01 14:09 UTC (permalink / raw)
  To: torvalds, akpm
  Cc: dhowells, marc.c.dionne, kirill, linux-kernel, linux-cachefs


From: Marc Dionne <marc.c.dionne@gmail.com>

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 <marc.c.dionne@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/cachefiles/rdwr.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index 1d83325..a6c8c6f 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -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;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-01 14:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01 14:09 [PATCH] CacheFiles: Update IMA counters when using dentry_open David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox