[RFC/PATCH -next 00/21] Address sanitizer for kernel (kasan) - dynamic memory error detector.

Andrey Ryabinin a.ryabinin at samsung.com
Tue Jul 15 07:32:23 PDT 2014


On 07/14/14 19:13, Christoph Lameter wrote:
> On Sun, 13 Jul 2014, Andrey Ryabinin wrote:
> 
>>> How does that work when memory is sparsely populated?
>>>
>>
>> Sparsemem configurations currently may not work with kasan.
>> I suppose I will have to move shadow area to vmalloc address space and
>> make it (shadow) sparse too if needed.
> 
> Well it seems to work with sparsemem / vmemmap? So non vmmemmapped configs
> of sparsemem only. vmemmmap can also handle holes in memory.
> 
> 

Not sure. This sparsemem/vmemmap thing is kinda new to me, so I need to dig some more
to understand how it iтteracts with kasan.

As far as I understand the main problem with sparsemem & kasan is shadow allocation:

	unsigned long lowmem_size = (unsigned long)high_memory - PAGE_OFFSET;
	shadow_size = lowmem_size >> KASAN_SHADOW_SCALE_SHIFT;

	shadow_phys_start = memblock_alloc(shadow_size, PAGE_SIZE);

If we don't have one big enough physically contiguous block for shadow it will fail.




More information about the linux-arm-kernel mailing list