integrity: fix IMA inode leak
authorHugh Dickins <hugh.dickins@tiscali.co.uk>
Sat, 6 Jun 2009 20:18:09 +0000 (21:18 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Jun 2009 21:33:41 +0000 (14:33 -0700)
CONFIG_IMA=y inode activity leaks iint_cache and radix_tree_node objects
until the system runs out of memory.  Nowhere is calling ima_inode_free()
a.k.a. ima_iint_delete().  Fix that by calling it from destroy_inode().

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/inode.c

index a4876e561953c8c1a2f3eb507d1c47ac4de3f008..bca0c618fdb35cc762c772b8cf3fe06c31e6b5e4 100644 (file)
@@ -219,6 +219,7 @@ 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);
        if (inode->i_sb->s_op->destroy_inode)
                inode->i_sb->s_op->destroy_inode(inode);