[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAG_fn=XTeQ5TgxWRKSnAt3b+rkw4H6c=h3h36UGMeBben4TMsA@mail.gmail.com>
Date: Thu, 28 Apr 2016 13:31:14 +0200
From: Alexander Potapenko <glider@...gle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrey Konovalov <adech.fo@...il.com>,
Dmitriy Vyukov <dvyukov@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
Kostya Serebryany <kcc@...gle.com>,
kasan-dev <kasan-dev@...glegroups.com>,
LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>
Subject: Re: [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from ksize().
On Fri, Apr 22, 2016 at 11:32 PM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
> On Wed, 13 Apr 2016 13:20:09 +0200 Alexander Potapenko <glider@...gle.com> wrote:
>
>> Instead of calling kasan_krealloc(), which replaces the memory allocation
>> stack ID (if stack depot is used), just unpoison the whole memory chunk.
>
> I don't understand why these two patches exist. Bugfix? Cleanup?
> Optimization?
It's incorrect to call kasan_krealloc() from ksize(), because the
former may touch the allocation metadata (it does so for the SLAB
allocator).
Yes, this is a bugfix.
>
> I had to change kmalloc_tests_init() a bit due to
> mm-kasan-initial-memory-quarantine-implementation.patch:
>
> kasan_stack_oob();
> kasan_global_oob();
> #ifdef CONFIG_SLAB
> kasan_quarantine_cache();
> #endif
> + ksize_unpoisons_memory();
> return -EAGAIN;
> }
>
> Please check.
Ack.
--
Alexander Potapenko
Software Engineer
Google Germany GmbH
Erika-Mann-Straße, 33
80636 München
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Powered by blists - more mailing lists