audit-related slab memory leak in recent -mm kernels?

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Fri Feb 24 18:41:24 UTC 2006


For a while, I've been seeing a pretty serious leak in slab-32 entries in -mm
kernels. Doing a quilt bisection on -mm calls out git-audit.patch as the
offender.

In kernel/auditsc.c, we have audit_inode_context(), which does:

        ctx = kmalloc(len, GFP_KERNEL);
	...
        context->names[idx].ctx = ctx;

but the only obvious kfree() I can find is in audit_free_names(), but that
one is (a) inside an if statement along with a printk(KERN_ERR) and (b) has
a '#if AUDIT_DEBUG == 2' around it.

[/usr/src/linux-2.6.16-rc4-mm2/kernel]1 grep -n '\.ctx' *.c
auditsc.c:384:                  kfree(context->names[i].ctx);
auditsc.c:686:          if (context->names[i].ctx) {
auditsc.c:688:                                  context->names[i].ctx);
auditsc.c:961:  context->names[idx].ctx = ctx;

Is this my memory leak?  If so, who is supposed to be freeing it?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-audit/attachments/20060224/dacaee9d/attachment.sig>


More information about the Linux-audit mailing list