mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: Re: [2.6.31] Memory leak in load_module()?
Date: Fri, 11 Sep 2009 12:16:58 +0100	[thread overview]
Message-ID: <1252667819.29620.7.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <200909111958.HFG60925.OOQLHFFVtSJOMF@I-love.SAKURA.ne.jp>

On Fri, 2009-09-11 at 19:58 +0900, Tetsuo Handa wrote:
> OK. Here is the output with CONFIG_FRAME_POINTER=y .
> Do I need to enable some other debug options?
> 
> unreferenced object 0xdd7c1718 (size 32):
>   comm "insmod", pid 2859, jiffies 4294757534
>   backtrace:
>     [<c048a210>] create_object+0x135/0x202
>     [<c048a302>] kmemleak_alloc+0x25/0x49
>     [<c04865bd>] kmemleak_alloc_recursive+0x1c/0x22
>     [<c0486e27>] __kmalloc_track_caller+0x66/0xb3
>     [<c0473980>] kstrdup+0x2c/0x4e
>     [<c044716a>] setup_modinfo_srcversion+0x12/0x1b
>     [<c0448725>] load_module+0x866/0x124a
>     [<c0449180>] sys_init_module+0x49/0x1b9
>     [<c0402a24>] sysenter_do_call+0x12/0x22
>     [<ffffffff>] 0xffffffff

The object above was allocated by kstrdup via setup_modinfo_srcversion
but the module loading failed and no other kernel part freed the
mod->filed object. I think it's a real leak but you could try a few
"echo scan" to make sure it's not just a temporary false positive.

(the kmemleak branch on git://linux-arm.org/linux-2.6.git has a patch
which dumps the first few bytes from the object and sometimes this
helps; I'll send a pull request to Linus sometime today)

-- 
Catalin


  reply	other threads:[~2009-09-11 11:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11  7:38 Tetsuo Handa
2009-09-11  9:29 ` Catalin Marinas
2009-09-11 10:58   ` Tetsuo Handa
2009-09-11 11:16     ` Catalin Marinas [this message]
2009-09-11 12:08       ` Tetsuo Handa
2009-09-22  2:30 ` Rusty Russell
2009-09-22  4:07   ` Tetsuo Handa

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=1252667819.29620.7.camel@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®