File tree Expand file tree Collapse file tree 5 files changed +38
-0
lines changed Expand file tree Collapse file tree 5 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -366,3 +366,8 @@ config PPC_FAST_ENDIAN_SWITCH
366
366
depends on DEBUG_KERNEL && PPC_BOOK3S_64
367
367
help
368
368
If you're unsure what this is, say N.
369
+
370
+ config KASAN_SHADOW_OFFSET
371
+ hex
372
+ depends on KASAN
373
+ default 0xe0000000
Original file line number Diff line number Diff line change 22
22
#include <asm/kmap_types.h>
23
23
#endif
24
24
25
+ #ifdef CONFIG_KASAN
26
+ #include <asm/kasan.h>
27
+ #define FIXADDR_TOP (KASAN_SHADOW_START - PAGE_SIZE)
28
+ #else
25
29
#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE))
30
+ #endif
26
31
27
32
/*
28
33
* Here we define all the compile-time 'special' virtual
Original file line number Diff line number Diff line change 12
12
#define EXPORT_SYMBOL_KASAN (fn )
13
13
#endif
14
14
15
+ #ifndef __ASSEMBLY__
16
+
17
+ #include <asm/page.h>
18
+
19
+ #define KASAN_SHADOW_SCALE_SHIFT 3
20
+
21
+ #define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
22
+ (PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT))
23
+
24
+ #define KASAN_SHADOW_OFFSET ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET)
25
+
26
+ #define KASAN_SHADOW_END 0UL
27
+
28
+ #define KASAN_SHADOW_SIZE (KASAN_SHADOW_END - KASAN_SHADOW_START)
29
+
30
+ #endif /* __ASSEMBLY */
15
31
#endif
Original file line number Diff line number Diff line change @@ -310,6 +310,10 @@ void __init mem_init(void)
310
310
mem_init_print_info (NULL );
311
311
#ifdef CONFIG_PPC32
312
312
pr_info ("Kernel virtual memory layout:\n" );
313
+ #ifdef CONFIG_KASAN
314
+ pr_info (" * 0x%08lx..0x%08lx : kasan shadow mem\n" ,
315
+ KASAN_SHADOW_START , KASAN_SHADOW_END );
316
+ #endif
313
317
pr_info (" * 0x%08lx..0x%08lx : fixmap\n" , FIXADDR_START , FIXADDR_TOP );
314
318
#ifdef CONFIG_HIGHMEM
315
319
pr_info (" * 0x%08lx..0x%08lx : highmem PTEs\n" ,
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ static struct addr_marker address_markers[] = {
100
100
#endif
101
101
{ 0 , "Fixmap start" },
102
102
{ 0 , "Fixmap end" },
103
+ #endif
104
+ #ifdef CONFIG_KASAN
105
+ { 0 , "kasan shadow mem start" },
106
+ { 0 , "kasan shadow mem end" },
103
107
#endif
104
108
{ -1 , NULL },
105
109
};
@@ -323,6 +327,10 @@ static void populate_markers(void)
323
327
#endif
324
328
address_markers [i ++ ].start_address = FIXADDR_START ;
325
329
address_markers [i ++ ].start_address = FIXADDR_TOP ;
330
+ #ifdef CONFIG_KASAN
331
+ address_markers [i ++ ].start_address = KASAN_SHADOW_START ;
332
+ address_markers [i ++ ].start_address = KASAN_SHADOW_END ;
333
+ #endif
326
334
#endif /* CONFIG_PPC64 */
327
335
}
328
336
You can’t perform that action at this time.
0 commit comments