LSM: imbed ima calls in the security hooks
Based on discussions on LKML and LSM, where there are consecutive security_ and ima_ calls in the vfs layer, move the ima_ calls to the existing security_ hooks. Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
10
fs/inode.c
10
fs/inode.c
@@ -18,7 +18,6 @@
|
||||
#include <linux/hash.h>
|
||||
#include <linux/swap.h>
|
||||
#include <linux/security.h>
|
||||
#include <linux/ima.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/bootmem.h>
|
||||
@@ -157,11 +156,6 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
|
||||
|
||||
if (security_inode_alloc(inode))
|
||||
goto out;
|
||||
|
||||
/* allocate and initialize an i_integrity */
|
||||
if (ima_inode_alloc(inode))
|
||||
goto out_free_security;
|
||||
|
||||
spin_lock_init(&inode->i_lock);
|
||||
lockdep_set_class(&inode->i_lock, &sb->s_type->i_lock_key);
|
||||
|
||||
@@ -201,9 +195,6 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
out_free_security:
|
||||
security_inode_free(inode);
|
||||
out:
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -235,7 +226,6 @@ static struct inode *alloc_inode(struct super_block *sb)
|
||||
void __destroy_inode(struct inode *inode)
|
||||
{
|
||||
BUG_ON(inode_has_buffers(inode));
|
||||
ima_inode_free(inode);
|
||||
security_inode_free(inode);
|
||||
fsnotify_inode_delete(inode);
|
||||
#ifdef CONFIG_FS_POSIX_ACL
|
||||
|
Reference in New Issue
Block a user