From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mimi Zohar Subject: [PATCH 13/15] ima: inode post_setattr Date: Thu, 24 Jun 2010 14:10:29 -0400 Message-ID: <1277403031-3080-14-git-send-email-zohar@linux.vnet.ibm.com> References: <1277403031-3080-1-git-send-email-zohar@linux.vnet.ibm.com> Cc: Mimi Zohar , linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, James Morris , David Safford , Dave Hansen , Mimi Zohar To: linux-kernel@vger.kernel.org Return-path: In-Reply-To: <1277403031-3080-1-git-send-email-zohar@linux.vnet.ibm.com> Sender: linux-security-module-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 Acked-by: Serge Hallyn --- 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 #include #include +#include /* 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.6.6.1