linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ryabinin <ryabinin.a.a@gmail.com>
To: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <adech.fo@gmail.com>,
	Christoph Lameter <cl@linux.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	JoonSoo Kim <js1304@gmail.com>,
	Kostya Serebryany <kcc@google.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH v5 2/7] mm, kasan: SLAB support
Date: Fri, 11 Mar 2016 16:57:58 +0300	[thread overview]
Message-ID: <CAPAsAGxM+D9c_VCoL77D9DwZa5gzeO3nRW3tNpwKnuo7fzgJVg@mail.gmail.com> (raw)
In-Reply-To: <CAG_fn=UFB3UYg0-uw4TUJvuvu9ZkqqTKG4enMFMXyWC-q65SeA@mail.gmail.com>

2016-03-11 16:05 GMT+03:00 Alexander Potapenko <glider@google.com>:
> On Fri, Mar 11, 2016 at 12:47 PM, Andrey Ryabinin
> <ryabinin.a.a@gmail.com> wrote:
>> 2016-03-09 14:05 GMT+03:00 Alexander Potapenko <glider@google.com>:
>>
>>> +struct kasan_track {
>>> +       u64 cpu : 6;                    /* for NR_CPUS = 64 */
>>
>> What about NR_CPUS > 64 ?
> After a discussion with Dmitry we've decided to drop |cpu| and |when|
> at all, as they do not actually help debugging.
> This way we'll make kasan_track only 8 bytes (4 bytes for PID, 4 bytes
> for stack handle).
> Then the meta structures will be smaller and have nice alignment:
>

Sounds good.

> struct kasan_track {
>         u32 pid;
>         depot_stack_handle_t stack;
> };
>
> struct kasan_alloc_meta {
>         struct kasan_track track;
>         u32 state : 2;  /* enum kasan_state */
>         u32 alloc_size : 30;
>         u32 reserved;  /* we can use it to store an additional stack
> handle, e.g. for debugging RCU */
> };
>
> struct kasan_free_meta {
>         /* This field is used while the object is in the quarantine.
>          * Otherwise it might be used for the allocator freelist.
>          */
>         void **quarantine_link;
>         struct kasan_track track;
> };
>
>
>>> +       u64 pid : 16;                   /* 65536 processes */
>>> +       u64 when : 42;                  /* ~140 years */
>>> +};
>>> +
>
>
>
> --
> 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-03-11 13:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 11:05 [PATCH v4 0/7] SLAB support for KASAN Alexander Potapenko
2016-03-09 11:05 ` [PATCH v5 1/7] kasan: Modify kmalloc_large_oob_right(), add kmalloc_pagealloc_oob_right() Alexander Potapenko
2016-03-09 11:05 ` [PATCH v5 2/7] mm, kasan: SLAB support Alexander Potapenko
2016-03-11 11:47   ` Andrey Ryabinin
2016-03-11 13:05     ` Alexander Potapenko
2016-03-11 13:57       ` Andrey Ryabinin [this message]
2016-03-09 11:05 ` [PATCH v5 3/7] mm, kasan: Added GFP flags to KASAN API Alexander Potapenko
2016-03-09 11:05 ` [PATCH v5 4/7] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections Alexander Potapenko
2016-03-09 11:05 ` [PATCH v5 5/7] mm, kasan: Stackdepot implementation. Enable stackdepot for SLAB Alexander Potapenko
2016-03-09 20:09   ` Andrew Morton
2016-03-10 14:00     ` Alexander Potapenko
2016-03-09 11:05 ` [PATCH v5 6/7] kasan: Test fix: Warn if the UAF could not be detected in kmalloc_uaf2 Alexander Potapenko
2016-03-09 11:05 ` [PATCH v5 7/7] mm: kasan: Initial memory quarantine implementation Alexander Potapenko
2016-03-09 20:21   ` Andrew Morton
2016-03-10 13:50     ` Alexander Potapenko
2016-03-10 20:14       ` Andrew Morton
2016-03-11 10:05         ` Alexander Potapenko
2016-03-11 17:12       ` Alexander Potapenko
2016-03-09 11:12 ` [PATCH v4 0/7] SLAB support for KASAN Alexander Potapenko
2016-03-09 20:23 ` [PATCH v5 " Andrew Morton
2016-03-10 17:01   ` Andrey Ryabinin

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=CAPAsAGxM+D9c_VCoL77D9DwZa5gzeO3nRW3tNpwKnuo7fzgJVg@mail.gmail.com \
    --to=ryabinin.a.a@gmail.com \
    --cc=adech.fo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=js1304@gmail.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rostedt@goodmis.org \
    /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