On Wed, Feb 27, 2019 at 08:07:31AM +0100, Vlastimil Babka wrote: > > I don't know _what_ Ming Lei is saying. I thought the problem was > > with slab redzones, which need to be before and after each object, > > but apparently the problem is with KASAN as well. > > That's what I thought as well. But if we can solve it for caches created > by kmem_cache_create(..., align, ...) then IMHO we could guarantee > natural alignment for power-of-two kmalloc caches as well. Yes, having a version of kmalloc that guarantees power of two alignment would be extremely helpful and avoid a lot of pointless boilerplate code.