public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	majianpeng <majianpeng@gmail.com>
Subject: Re: Possible memory leaks in proc_sysctl.c
Date: Wed, 18 Apr 2012 15:18:52 +0100	[thread overview]
Message-ID: <20120418141851.GG1505@arm.com> (raw)
In-Reply-To: <m1wr5d18fy.fsf@fess.ebiederm.org>

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

  reply	other threads:[~2012-04-18 14:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 10:12 Possible memory leaks in proc_sysctl.c Catalin Marinas
2012-04-18 13:22 ` Eric W. Biederman
2012-04-18 14:18   ` Catalin Marinas [this message]
2012-04-18 14:52     ` Eric W. Biederman
2012-04-18 15:15       ` Catalin Marinas
2012-04-18 15:44         ` Eric W. Biederman
2012-04-18 16:14           ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120418141851.GG1505@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=majianpeng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox