Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355917

Re: [PATCH v5 2/7] mm, kasan: SLAB support

From Andrey Ryabinin <ryabinin.a.a@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 2/7] mm, kasan: SLAB support
Date 2016-03-11 15:00 +0100
Message-ID <rbvLI-73L-1@gated-at.bofh.it> (permalink)
References <raKa5-735-3@gated-at.bofh.it> <raKa5-735-1@gated-at.bofh.it> <rbtJV-5CI-17@gated-at.bofh.it> <rbuZj-6Kj-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v5 2/7] mm, kasan: SLAB support Alexander Potapenko <glider@google.com> - 2016-03-09 12:10 +0100
  Re: [PATCH v5 2/7] mm, kasan: SLAB support Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-03-11 12:50 +0100
    Re: [PATCH v5 2/7] mm, kasan: SLAB support Alexander Potapenko <glider@google.com> - 2016-03-11 14:10 +0100
      Re: [PATCH v5 2/7] mm, kasan: SLAB support Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-03-11 15:00 +0100

csiph-web