lkml.org 
[lkml]   [2012]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Possible memory leaks in proc_sysctl.c
On Wed, Apr 18, 2012 at 02:22:09PM +0100, Eric W. Biederman wrote:
> Catalin Marinas <catalin.marinas@arm.com> writes:
> > Following your commit f728019bb (sysctl: register only tables of sysctl
> > files), I get several kmemleak reports. They all seem to be header
> > allocations with kzalloc() in __register_sysctl_table() and
> > __register_sysctl_paths(). The patch isn't simple to quickly figure out
> > what may be wrong.
>
> Due to a change in the data structure places where we register the
> sysctl permanently and ignore the result from the register_sysctl_...
> family of functions now report this leak.

But is the header (or subheader, basically any pointer inside the
kmalloc'ed object) never referenced from anywhere? I'm just trying to
understand why kmemleak reports it as it seems that the header object is
inserted in a ctl_dir.

> majianpeng has done a good of getting kmemleak_not_leak annotations into
> the net tree, and I have one of his patches pending to put into my
> sysctl tree (see below).

If the header is referenced from somewhere, we can tell kmemleak where
it is referenced from and avoid the not_leak annotations. But I'm not
familiar with this code to be sure.

Thanks.

--
Catalin


\
 
 \ /
  Last update: 2012-04-18 22:37    [W:0.078 / U:1.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site