[Devel] [PATCH 2/4] mm, slub, kasan: enable user tracking by default.

Andrey Ryabinin aryabinin at odin.com
Mon Sep 7 07:11:29 PDT 2015



On 09/07/2015 04:56 PM, Vladimir Davydov wrote:
> On Fri, Sep 04, 2015 at 05:06:14PM +0300, Andrey Ryabinin wrote:
> ...
>> @@ -457,6 +457,8 @@ static void get_map(struct kmem_cache *s, struct page *page, unsigned long *map)
>>   */
>>  #ifdef CONFIG_SLUB_DEBUG_ON
>>  static int slub_debug = DEBUG_DEFAULT_FLAGS;
>> +#elif defined (CONFIG_KASAN)
>> +static int slub_debug = SLAB_STORE_USER;
> 
> Why not just enable SLUB_DEBUG_ON for debug kernels?

We could, but I think that this patch make sense anyway.

When user enables CONFIG_KASAN=y, he also have to change boot cmdline,
So the problem here is that just replacing kernel is not enough, you also need to change boot cmdline.
And once user is going to switch to CONFIG_KASAN=n back, he will need to change boot cmdline again.

Of course we also could 'select SLUB_DEBUG_ON' under CONFIG_KASAN,
but this will enable useless (under CONFIG_KASAN=y) red zoning and poisoning.

>>  #else
>>  static int slub_debug;
>>  #endif



More information about the Devel mailing list