RE: [PATCH v3 1/2] mm, kasan: improve double-free detection

2016-05-29 Thread Luruo, Kuthonuzo
> >> > +/* flags shadow for object header if it has been overwritten. */ > >> > +void kasan_mark_bad_meta(struct kasan_alloc_meta *alloc_info, > >> > + struct kasan_access_info *info) > >> > +{ > >> > + u8 *datap = (u8 *)&alloc_info->data; > >> > + > >> > + if u8 *)inf

Re: [PATCH v3 1/2] mm, kasan: improve double-free detection

2016-05-29 Thread Dmitry Vyukov
On Sun, May 29, 2016 at 4:45 PM, Luruo, Kuthonuzo wrote: >> > +/* flags shadow for object header if it has been overwritten. */ >> > +void kasan_mark_bad_meta(struct kasan_alloc_meta *alloc_info, >> > + struct kasan_access_info *info) >> > +{ >> > + u8 *datap = (u8 *)&alloc_inf

RE: [PATCH v3 1/2] mm, kasan: improve double-free detection

2016-05-29 Thread Luruo, Kuthonuzo
> > +/* flags shadow for object header if it has been overwritten. */ > > +void kasan_mark_bad_meta(struct kasan_alloc_meta *alloc_info, > > + struct kasan_access_info *info) > > +{ > > + u8 *datap = (u8 *)&alloc_info->data; > > + > > + if u8 *)info->access_addr + info

Re: [PATCH v3 1/2] mm, kasan: improve double-free detection

2016-05-29 Thread Dmitry Vyukov
On Tue, May 24, 2016 at 8:30 PM, Kuthonuzo Luruo wrote: > Currently, KASAN may fail to detect concurrent deallocations of the same > object due to a race in kasan_slab_free(). This patch makes double-free > detection more reliable by serializing access to KASAN object metadata. > New functions kas

[PATCH v3 1/2] mm, kasan: improve double-free detection

2016-05-24 Thread Kuthonuzo Luruo
Currently, KASAN may fail to detect concurrent deallocations of the same object due to a race in kasan_slab_free(). This patch makes double-free detection more reliable by serializing access to KASAN object metadata. New functions kasan_meta_lock() and kasan_meta_unlock() are provided to lock/unloc