lkml.org 
[lkml]   [2010]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 12/14] ima: inode post_setattr
Date
Changing an inode's metadata may result in our not needing to
appraise the file. In such cases, we must remove 'security.ima'.

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
---
fs/attr.c | 2 ++
include/linux/ima.h | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/fs/attr.c b/fs/attr.c
index 9293710..f410bde 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -14,6 +14,7 @@
#include <linux/fcntl.h>
#include <linux/security.h>
#include <linux/evm.h>
+#include <linux/ima.h>

/* Taken over from the old code... */

@@ -251,6 +252,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr)

if (!error) {
fsnotify_change(dentry, ia_valid);
+ ima_inode_post_setattr(dentry);
evm_inode_post_setattr(dentry, ia_valid);
}

diff --git a/include/linux/ima.h b/include/linux/ima.h
index 4dce900..ce82e29 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -19,6 +19,7 @@ extern int ima_file_check(struct file *file, int mask);
extern void ima_file_free(struct file *file);
extern int ima_file_mmap(struct file *file, unsigned long prot);
extern void ima_counts_get(struct file *file);
+extern void ima_inode_post_setattr(struct dentry *dentry);

#else
static inline int ima_bprm_check(struct linux_binprm *bprm)
@@ -46,5 +47,10 @@ static inline void ima_counts_get(struct file *file)
return;
}

+static inline void ima_inode_post_setattr(struct dentry *dentry)
+{
+ return;
+}
+
#endif /* CONFIG_IMA_H */
#endif /* _LINUX_IMA_H */
--
1.7.1.1


\
 
 \ /
  Last update: 2010-07-22 22:49    [W:0.058 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site