From: Catalin Marinas <catalin.marinas@arm.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, ryabinin.a.a@gmail.com,
kasan-dev@googlegroups.com, glider@google.com
Subject: Re: [PATCH] mm: prevent KASAN false positives in kmemleak
Date: Thu, 23 Jun 2016 10:59:51 +0100 [thread overview]
Message-ID: <20160623095951.GH6521@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <1466617631-68387-1-git-send-email-dvyukov@google.com>
On Wed, Jun 22, 2016 at 07:47:11PM +0200, Dmitry Vyukov wrote:
> When kmemleak dumps contents of leaked objects it reads whole
> objects regardless of user-requested size. This upsets KASAN.
> Disable KASAN checks around object dump.
>
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> ---
> mm/kmemleak.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index e642992..04320d3 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -307,8 +307,10 @@ static void hex_dump_object(struct seq_file *seq,
> len = min_t(size_t, object->size, HEX_MAX_LINES * HEX_ROW_SIZE);
>
> seq_printf(seq, " hex dump (first %zu bytes):\n", len);
> + kasan_disable_current();
> seq_hex_dump(seq, " ", DUMP_PREFIX_NONE, HEX_ROW_SIZE,
> HEX_GROUP_SIZE, ptr, len, HEX_ASCII);
> + kasan_enable_current();
> }
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>
prev parent reply other threads:[~2016-06-23 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 17:47 [PATCH] mm: prevent KASAN false positives in kmemleak Dmitry Vyukov
2016-06-23 9:59 ` 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=20160623095951.GH6521@e104818-lin.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=akpm@linux-foundation.org \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryabinin.a.a@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;
as well as URLs for NNTP newsgroup(s).