Re: [PATCH v2 1/3] kasan: support backing vmalloc space with real shadow memory

2019-07-31 Thread Daniel Axtens
Daniel Axtens writes: > Hi Mark, > > Thanks for your email - I'm very new to mm stuff and the feedback is > very helpful. > >>> +#ifndef CONFIG_KASAN_VMALLOC >>> int kasan_module_alloc(void *addr, size_t size) >>> { >>> void *ret; >>> @@ -603,6 +604,7 @@ void kasan_free_shadow(const struct

Re: [PATCH v2 1/3] kasan: support backing vmalloc space with real shadow memory

2019-07-30 Thread Daniel Axtens
Hi Mark, Thanks for your email - I'm very new to mm stuff and the feedback is very helpful. >> +#ifndef CONFIG_KASAN_VMALLOC >> int kasan_module_alloc(void *addr, size_t size) >> { >> void *ret; >> @@ -603,6 +604,7 @@ void kasan_free_shadow(const struct vm_struct *vm) >> if

Re: [PATCH v2 1/3] kasan: support backing vmalloc space with real shadow memory

2019-07-29 Thread Mark Rutland
Hi Daniel, On Tue, Jul 30, 2019 at 12:21:06AM +1000, Daniel Axtens wrote: > Hook into vmalloc and vmap, and dynamically allocate real shadow > memory to back the mappings. > > Most mappings in vmalloc space are small, requiring less than a full > page of shadow space. Allocating a full shadow

[PATCH v2 1/3] kasan: support backing vmalloc space with real shadow memory

2019-07-29 Thread Daniel Axtens
Hook into vmalloc and vmap, and dynamically allocate real shadow memory to back the mappings. Most mappings in vmalloc space are small, requiring less than a full page of shadow space. Allocating a full shadow page per mapping would therefore be wasteful. Furthermore, to ensure that different