linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] kasan: fix kmemleak false-positive in kasan_module_alloc()
Date: Wed, 18 Nov 2015 10:20:49 +0000	[thread overview]
Message-ID: <CAHkRjk4OgZQWZkDaQfvEG3EyND2HvvFjzZTvQt2syqgdJ2zZ6A@mail.gmail.com> (raw)
In-Reply-To: <1447838814-31109-1-git-send-email-aryabinin@virtuozzo.com>

On 18 November 2015 at 09:26, Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
> Kmemleak reports the following leak:
>         unreferenced object 0xfffffbfff41ea000 (size 20480):
>         comm "modprobe", pid 65199, jiffies 4298875551 (age 542.568s)
>         hex dump (first 32 bytes):
>           00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>           00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>         backtrace:
>           [<ffffffff82354f5e>] kmemleak_alloc+0x4e/0xc0
>           [<ffffffff8152e718>] __vmalloc_node_range+0x4b8/0x740
>           [<ffffffff81574072>] kasan_module_alloc+0x72/0xc0
>           [<ffffffff810efe68>] module_alloc+0x78/0xb0
>           [<ffffffff812f6a24>] module_alloc_update_bounds+0x14/0x70
>           [<ffffffff812f8184>] layout_and_allocate+0x16f4/0x3c90
>           [<ffffffff812faa1f>] load_module+0x2ff/0x6690
>           [<ffffffff813010b6>] SyS_finit_module+0x136/0x170
>           [<ffffffff8239bbc9>] system_call_fastpath+0x16/0x1b
>           [<ffffffffffffffff>] 0xffffffffffffffff
>
> kasan_module_alloc() allocates shadow memory for module and frees it on
> module unloading. It doesn't store the pointer to allocated shadow memory
> because it could be calculated from the shadowed address, i.e. kasan_mem_to_shadow(addr).
> Since kmemleak cannot find pointer to allocated shadow, it thinks that
> memory leaked.
>
> Use kmemleak_ignore() to tell kmemleak that this is not a leak and shadow
> memory doesn't contain any pointers.
>
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2015-11-18 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18  9:26 Andrey Ryabinin
2015-11-18 10:20 ` Catalin Marinas [this message]

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=CAHkRjk4OgZQWZkDaQfvEG3EyND2HvvFjzZTvQt2syqgdJ2zZ6A@mail.gmail.com \
    --to=catalin.marinas@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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