@@ -277,6 +277,7 @@ void __init kasan_early_init(void)
277
277
void __init kasan_init (void )
278
278
{
279
279
int i ;
280
+ void * shadow_cpu_entry_begin , * shadow_cpu_entry_end ;
280
281
281
282
#ifdef CONFIG_KASAN_INLINE
282
283
register_die_notifier (& kasan_die_notifier );
@@ -329,8 +330,23 @@ void __init kasan_init(void)
329
330
(unsigned long )kasan_mem_to_shadow (_end ),
330
331
early_pfn_to_nid (__pa (_stext )));
331
332
333
+ shadow_cpu_entry_begin = (void * )__fix_to_virt (FIX_CPU_ENTRY_AREA_BOTTOM );
334
+ shadow_cpu_entry_begin = kasan_mem_to_shadow (shadow_cpu_entry_begin );
335
+ shadow_cpu_entry_begin = (void * )round_down ((unsigned long )shadow_cpu_entry_begin ,
336
+ PAGE_SIZE );
337
+
338
+ shadow_cpu_entry_end = (void * )(__fix_to_virt (FIX_CPU_ENTRY_AREA_TOP ) + PAGE_SIZE );
339
+ shadow_cpu_entry_end = kasan_mem_to_shadow (shadow_cpu_entry_end );
340
+ shadow_cpu_entry_end = (void * )round_up ((unsigned long )shadow_cpu_entry_end ,
341
+ PAGE_SIZE );
342
+
332
343
kasan_populate_zero_shadow (kasan_mem_to_shadow ((void * )MODULES_END ),
333
- (void * )KASAN_SHADOW_END );
344
+ shadow_cpu_entry_begin );
345
+
346
+ kasan_populate_shadow ((unsigned long )shadow_cpu_entry_begin ,
347
+ (unsigned long )shadow_cpu_entry_end , 0 );
348
+
349
+ kasan_populate_zero_shadow (shadow_cpu_entry_end , (void * )KASAN_SHADOW_END );
334
350
335
351
load_cr3 (init_top_pgt );
336
352
__flush_tlb_all ();
0 commit comments