|
|
@@ -1501,11 +1501,6 @@ static void kmemleak_scan(void)
|
|
|
}
|
|
|
rcu_read_unlock();
|
|
|
|
|
|
- /* data/bss scanning */
|
|
|
- scan_large_block(_sdata, _edata);
|
|
|
- scan_large_block(__bss_start, __bss_stop);
|
|
|
- scan_large_block(__start_ro_after_init, __end_ro_after_init);
|
|
|
-
|
|
|
#ifdef CONFIG_SMP
|
|
|
/* per-cpu sections scanning */
|
|
|
for_each_possible_cpu(i)
|
|
|
@@ -2036,6 +2031,17 @@ void __init kmemleak_init(void)
|
|
|
}
|
|
|
local_irq_restore(flags);
|
|
|
|
|
|
+ /* register the data/bss sections */
|
|
|
+ create_object((unsigned long)_sdata, _edata - _sdata,
|
|
|
+ KMEMLEAK_GREY, GFP_ATOMIC);
|
|
|
+ create_object((unsigned long)__bss_start, __bss_stop - __bss_start,
|
|
|
+ KMEMLEAK_GREY, GFP_ATOMIC);
|
|
|
+ /* only register .data..ro_after_init if not within .data */
|
|
|
+ if (__start_ro_after_init < _sdata || __end_ro_after_init > _edata)
|
|
|
+ create_object((unsigned long)__start_ro_after_init,
|
|
|
+ __end_ro_after_init - __start_ro_after_init,
|
|
|
+ KMEMLEAK_GREY, GFP_ATOMIC);
|
|
|
+
|
|
|
/*
|
|
|
* This is the point where tracking allocations is safe. Automatic
|
|
|
* scanning is started during the late initcall. Add the early logged
|