Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1393674
| From | Dmitry Vyukov <dvyukov@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] kasan: improve double-free detection |
| Date | 2016-05-03 19:50 +0200 |
| Message-ID | <ruMCm-3Wx-9@gated-at.bofh.it> (permalink) |
| References | <ruiEi-Zl-9@gated-at.bofh.it> <ruj7k-1t7-17@gated-at.bofh.it> <rukwp-2DS-9@gated-at.bofh.it> <ruDpo-3Rg-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, May 3, 2016 at 9:53 AM, Luruo, Kuthonuzo
<kuthonuzo.luruo@hpe.com> wrote:
>> I missed that Alexander already landed patches that reduce header size
>> to 16 bytes.
>> It is not OK to increase them again. Please leave state as bitfield
>> and update it with CAS (if we introduce helper functions for state
>> manipulation, they will hide the CAS loop, which is nice).
>>
>
> Available CAS primitives/compiler do not support CAS with bitfield. I propose
> to change kasan_alloc_meta to:
>
> struct kasan_alloc_meta {
> struct kasan_track track;
> u16 size_delta; /* object_size - alloc size */
> u8 state; /* enum kasan_state */
> u8 reserved1;
> u32 reserved2;
> }
>
> This shrinks _used_ meta object by 1 byte wrt the original. (btw, patch v1 does
> not increase overall alloc meta object size). "Alloc size", where needed, is
> easily calculated as a delta from cache->object_size.
What is the maximum size that slab can allocate?
I remember seeing slabs as large as 4MB some time ago (or did I
confuse it with something else?). If there are such large objects,
that 2 bytes won't be able to hold even delta.
However, now on my desktop I don't see slabs larger than 16KB in /proc/slabinfo.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] kasan: improve double-free detection Kuthonuzo Luruo <kuthonuzo.luruo@hpe.com> - 2016-05-02 11:50 +0200
Re: [PATCH] kasan: improve double-free detection Dmitry Vyukov <dvyukov@google.com> - 2016-05-02 12:20 +0200
Re: [PATCH] kasan: improve double-free detection Dmitry Vyukov <dvyukov@google.com> - 2016-05-02 13:40 +0200
RE: [PATCH] kasan: improve double-free detection "Luruo, Kuthonuzo" <kuthonuzo.luruo@hpe.com> - 2016-05-03 11:30 +0200
Re: [PATCH] kasan: improve double-free detection Dmitry Vyukov <dvyukov@google.com> - 2016-05-03 20:00 +0200
RE: [PATCH] kasan: improve double-free detection "Luruo, Kuthonuzo" <kuthonuzo.luruo@hpe.com> - 2016-05-07 12:30 +0200
RE: [PATCH] kasan: improve double-free detection "Luruo, Kuthonuzo" <kuthonuzo.luruo@hpe.com> - 2016-05-02 13:40 +0200
Re: [PATCH] kasan: improve double-free detection Alexander Potapenko <glider@google.com> - 2016-05-02 13:50 +0200
RE: [PATCH] kasan: improve double-free detection "Luruo, Kuthonuzo" <kuthonuzo.luruo@hpe.com> - 2016-05-03 10:00 +0200
Re: [PATCH] kasan: improve double-free detection Dmitry Vyukov <dvyukov@google.com> - 2016-05-02 13:50 +0200
RE: [PATCH] kasan: improve double-free detection "Luruo, Kuthonuzo" <kuthonuzo.luruo@hpe.com> - 2016-05-03 10:00 +0200
Re: [PATCH] kasan: improve double-free detection Dmitry Vyukov <dvyukov@google.com> - 2016-05-03 19:50 +0200
RE: [PATCH] kasan: improve double-free detection "Luruo, Kuthonuzo" <kuthonuzo.luruo@hpe.com> - 2016-05-04 22:20 +0200
Re: [PATCH] kasan: improve double-free detection Dmitry Vyukov <dvyukov@google.com> - 2016-05-05 07:40 +0200
RE: [PATCH] kasan: improve double-free detection "Luruo, Kuthonuzo" <kuthonuzo.luruo@hpe.com> - 2016-05-05 08:30 +0200
Re: [PATCH] kasan: improve double-free detection Dmitry Vyukov <dvyukov@google.com> - 2016-05-05 09:00 +0200
RE: [PATCH] kasan: improve double-free detection "Luruo, Kuthonuzo" <kuthonuzo.luruo@hpe.com> - 2016-05-07 11:00 +0200
csiph-web