linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Konovalov <adech.fo@gmail.com>,
	Dmitriy Vyukov <dvyukov@google.com>,
	Christoph Lameter <cl@linux.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Kostya Serebryany <kcc@google.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from ksize().
Date: Thu, 28 Apr 2016 13:31:14 +0200	[thread overview]
Message-ID: <CAG_fn=XTeQ5TgxWRKSnAt3b+rkw4H6c=h3h36UGMeBben4TMsA@mail.gmail.com> (raw)
In-Reply-To: <20160422143259.b2d2c253da7ea6fa4b425269@linux-foundation.org>

On Fri, Apr 22, 2016 at 11:32 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Wed, 13 Apr 2016 13:20:09 +0200 Alexander Potapenko <glider@google.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

--
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:[~2016-04-28 11:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 11:20 [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from ksize() Alexander Potapenko
2016-04-13 11:20 ` [PATCH v2 2/2] mm, kasan: add a ksize() test Alexander Potapenko
2016-04-15 15:59   ` Andrey Ryabinin
2016-04-15 15:58 ` [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from ksize() Andrey Ryabinin
2016-04-22 21:32 ` Andrew Morton
2016-04-28 11:31   ` Alexander Potapenko [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='CAG_fn=XTeQ5TgxWRKSnAt3b+rkw4H6c=h3h36UGMeBben4TMsA@mail.gmail.com' \
    --to=glider@google.com \
    --cc=adech.fo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=dvyukov@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kcc@google.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).