Re: Size-128 slab leak

From: Kevin O'Connor
Date: Fri Feb 03 2006 - 20:13:46 EST


On Fri, Feb 03, 2006 at 08:21:12AM -0500, Stephen Smalley wrote:
> On Thu, 2006-02-02 at 23:00 -0500, Kevin O'Connor wrote:
> > After running updatedb I got 23530 occurrences of:
> >
> > kernel: obj ffff81003f04f000/12: ffffffff801ed7b7 <selinux_inode_alloc_security+0x37/0x100>
> >
> Hmm...that allocation call occurs upon alloc_inode() via
> security_inode_alloc, and the associated free call occurs upon
> destroy_inode() via security_inode_free. However, when Jeff Mahoney
> introduced the support for "private inodes" (S_PRIVATE flag) to support
> reiserfs xattrs-as-files, he added the IS_PRIVATE guards to both
> security_inode_alloc and security_inode_free. I think that this ends up
> causing SELinux to allocate a security structure for every reiserfs
> inode including private inodes since they are not marked until later by
> reiserfs, while preventing SELinux from ever freeing the security
> structure for the private inodes. Note that
> selinux_inode_free_security() should be safe even for the private
> inodes, as it doesn't assume any other initialization beyond the
> allocation-time initialization. Patch below.

Hi Stephen,

I've applied your patch. It seems to be working. (Multiple runs of
updatedb no longer grow the size-128 slab.)

Thanks,
-Kevin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/