[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160623095951.GH6521@e104818-lin.cambridge.arm.com>
Date: Thu, 23 Jun 2016 10:59:51 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, ryabinin.a.a@...il.com,
kasan-dev@...glegroups.com, glider@...gle.com
Subject: Re: [PATCH] mm: prevent KASAN false positives in kmemleak
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@...gle.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@....com>
Powered by blists - more mailing lists