lkml.org 
[lkml]   [2009]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] integrity: fix IMA inode leak
On Sat, 6 Jun 2009, Linus Torvalds wrote:
> On Sat, 6 Jun 2009, Linus Torvalds wrote:
> > On Sat, 6 Jun 2009, Hugh Dickins wrote:
> > >
> > > 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().
> >
> > Shouldn't we call it from "security_inode_free()" instead? And shouldn't
> > it be allocated in "security_inode_alloc()"? That sounds like the correct
> > nesting here, since the whole integrity thing is under the security
> > module.
> >
> > Hmm?

I wondered the same: quite possibly, but I tend to assume there was reason
to do it like that; and thought it best to mirror the security_inode_alloc,
ima_inode_alloc with ima_inode_free, security_inode_free for now.

(I also disliked the obfuscescent #define ima_iint_delete ima_inode_free
in ima_iint.c!)

>
> Oh well. I applied the patch as-is, since it seems to fix a real issue.

Thanks, yes. There is a possibility that it will reveal some warnings
from iint_free which were hidden before; but I've not seen them in normal
working, and I'd anyway prefer a few warnings to my boxes OOMing. Though
it was only by mistake that I had CONFIG_IMA=y in the first place.

>
> But I do think fs/inode.c shouldn't care about things like that, and have
> it internal to security_inode_alloc/free(). But I guess that's a separate
> cleanup.

The IMA stuff all looks rather bolted in on top; I did fail to persuade
Mimi to move the shmem and shm hooks down a level, so for now at least
they'll stay as they are.

Hugh


\
 
 \ /
  Last update: 2009-06-07 01:05    [W:0.103 / U:3.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site