linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: Joonsoo Kim <js1304@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	kasan-dev@googlegroups.com, Christoph Lameter <cl@linux.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Dmitriy Vyukov <dvyukov@google.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrey Konovalov <adech.fo@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v1 2/8] mm, kasan: SLAB support
Date: Fri, 19 Feb 2016 13:57:09 +0100	[thread overview]
Message-ID: <CAG_fn=V1VkfFmf3FO6KGSUxaXRsK-h9u7gtE-mSmXuESyg1o7g@mail.gmail.com> (raw)
In-Reply-To: <CAAmzW4M98a4pGF7kCx_273nPGNjsORY-MGSgx1y0+JzYNyAa1w@mail.gmail.com>

Ah, yes, I see.
This patch was indeed missing the following bits in kasan_slab_free():

#ifdef CONFIG_SLAB
 if (cache->flags & SLAB_KASAN) {
 struct kasan_free_meta *free_info =
 get_free_info(cache, object);
 struct kasan_alloc_meta *alloc_info =
 get_alloc_info(cache, object);
 alloc_info->state = KASAN_STATE_FREE;
 set_track(&free_info->track);
 }
#endif

I'll include them in the next round of patches.

On Fri, Feb 19, 2016 at 2:41 AM, Joonsoo Kim <js1304@gmail.com> wrote:
>> On Mon, Feb 1, 2016 at 3:15 AM, Joonsoo Kim <iamjoonsoo.kim@lge.com> wrote:
>>> On Thu, Jan 28, 2016 at 02:29:42PM +0100, Alexander Potapenko wrote:
>>>> On Thu, Jan 28, 2016 at 1:37 PM, Alexander Potapenko <glider@google.com> wrote:
>>>> >
>>>> > On Jan 28, 2016 8:44 AM, "Joonsoo Kim" <iamjoonsoo.kim@lge.com> wrote:
>>>> >>
>>>> >> On Wed, Jan 27, 2016 at 07:25:07PM +0100, Alexander Potapenko wrote:
>>>> >> > This patch adds KASAN hooks to SLAB allocator.
>>>> >> >
>>>> >> > This patch is based on the "mm: kasan: unified support for SLUB and
>>>> >> > SLAB allocators" patch originally prepared by Dmitry Chernenkov.
>>>> >> >
>>>> >> > Signed-off-by: Alexander Potapenko <glider@google.com>
>>>> >> > ---
>>>> >> >  Documentation/kasan.txt  |  5 ++-
>>>> >>
>>>> >> ...
>>>> >>
>>>> >> > +#ifdef CONFIG_SLAB
>>>> >> > +struct kasan_alloc_meta *get_alloc_info(struct kmem_cache *cache,
>>>> >> > +                                     const void *object)
>>>> >> > +{
>>>> >> > +     return (void *)object + cache->kasan_info.alloc_meta_offset;
>>>> >> > +}
>>>> >> > +
>>>> >> > +struct kasan_free_meta *get_free_info(struct kmem_cache *cache,
>>>> >> > +                                   const void *object)
>>>> >> > +{
>>>> >> > +     return (void *)object + cache->kasan_info.free_meta_offset;
>>>> >> > +}
>>>> >> > +#endif
>>>> >>
>>>> >> I cannot find the place to store stack info for free. get_free_info()
>>>> >> isn't used except print_object(). Plese let me know where.
>>>> >
>>>> > This is covered by other patches in this patchset.
>>>
>>> This should be covered by this patch. Stroing and printing free_info
>>> is already done on SLUB and it is meaningful without quarantain.
>
> 2016-02-18 21:58 GMT+09:00 Alexander Potapenko <glider@google.com>:
>> However this info is meaningless without saved stack traces, which are
>> only introduced in the stackdepot patch (see "[PATCH v1 5/8] mm,
>> kasan: Stackdepot implementation. Enable stackdepot for SLAB")
>
> Not meaningless. You already did it for allocation caller without saved
> stack traces. What makes difference between alloc/free?
>
> Thanks.



-- 
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
Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind,
leiten Sie diese bitte nicht weiter, informieren Sie den
Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank.
This e-mail is confidential. If you are not the right addressee please
do not forward it, please inform the sender, and please erase this
e-mail including any attachments. Thanks.

--
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-02-19 12:57 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 18:25 [PATCH v1 0/8] SLAB support for KASAN Alexander Potapenko
2016-01-27 18:25 ` [PATCH v1 1/8] kasan: Change the behavior of kmalloc_large_oob_right test Alexander Potapenko
2016-02-02  5:34   ` Andrew Morton
2016-02-02 15:29     ` Andrey Ryabinin
2016-02-02 16:25       ` Alexander Potapenko
2016-02-15 14:05         ` Alexander Potapenko
2016-01-27 18:25 ` [PATCH v1 2/8] mm, kasan: SLAB support Alexander Potapenko
2016-01-28  7:44   ` Joonsoo Kim
2016-01-28 12:37     ` Alexander Potapenko
2016-01-28 13:29       ` Alexander Potapenko
2016-02-01  2:15         ` Joonsoo Kim
2016-02-18 12:58           ` Alexander Potapenko
2016-02-19  1:41             ` Joonsoo Kim
2016-02-19 12:57               ` Alexander Potapenko [this message]
2016-01-27 18:25 ` [PATCH v1 3/8] mm, kasan: Added GFP flags to KASAN API Alexander Potapenko
2016-01-27 18:25 ` [PATCH v1 4/8] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections Alexander Potapenko
2016-01-28 14:53   ` Steven Rostedt
2016-01-29 11:33     ` Alexander Potapenko
2016-01-29 11:59       ` Alexander Potapenko
2016-01-29 14:45         ` Steven Rostedt
2016-02-16 15:32           ` Alexander Potapenko
2016-01-27 18:25 ` [PATCH v1 5/8] mm, kasan: Stackdepot implementation. Enable stackdepot for SLAB Alexander Potapenko
2016-01-28  7:40   ` Joonsoo Kim
2016-01-28 12:51     ` Alexander Potapenko
2016-01-28 13:27       ` Alexander Potapenko
2016-02-01  2:55         ` Joonsoo Kim
2016-02-16 18:37           ` Alexander Potapenko
2016-02-17 18:29             ` Alexander Potapenko
2016-02-18  8:13               ` Joonsoo Kim
2016-02-18 15:01                 ` Alexander Potapenko
2016-02-18  7:58             ` Joonsoo Kim
2016-01-27 18:25 ` [PATCH v1 6/8] kasan: Test fix: Warn if the UAF could not be detected in kmalloc_uaf2 Alexander Potapenko
2016-01-27 18:25 ` [PATCH v1 7/8] kasan: Changed kmalloc_large_oob_right, added kmalloc_pagealloc_oob_right Alexander Potapenko
2016-01-27 18:25 ` [PATCH v1 8/8] mm: kasan: Initial memory quarantine implementation Alexander Potapenko
2016-02-01  2:47   ` Joonsoo Kim
2016-02-18 14:06     ` Alexander Potapenko
2016-02-19  2:11       ` Joonsoo Kim
2016-02-19  9:19         ` Dmitry Vyukov
2016-02-19 15:43           ` Christoph Lameter
2016-02-23  7:23           ` Joonsoo Kim

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=V1VkfFmf3FO6KGSUxaXRsK-h9u7gtE-mSmXuESyg1o7g@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=iamjoonsoo.kim@lge.com \
    --cc=js1304@gmail.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rostedt@goodmis.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