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
366366 depends on DEBUG_KERNEL && PPC_BOOK3S_64
367367 help
368368 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 2222#include <asm/kmap_types.h>
2323#endif
2424
25+ #ifdef CONFIG_KASAN
26+ #include <asm/kasan.h>
27+ #define FIXADDR_TOP (KASAN_SHADOW_START - PAGE_SIZE)
28+ #else
2529#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE))
30+ #endif
2631
2732/*
2833 * Here we define all the compile-time 'special' virtual
Original file line number Diff line number Diff line change 1212#define EXPORT_SYMBOL_KASAN (fn )
1313#endif
1414
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 */
1531#endif
Original file line number Diff line number Diff line change @@ -310,6 +310,10 @@ void __init mem_init(void)
310310 mem_init_print_info (NULL );
311311#ifdef CONFIG_PPC32
312312 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
313317 pr_info (" * 0x%08lx..0x%08lx : fixmap\n" , FIXADDR_START , FIXADDR_TOP );
314318#ifdef CONFIG_HIGHMEM
315319 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[] = {
100100#endif
101101 { 0 , "Fixmap start" },
102102 { 0 , "Fixmap end" },
103+ #endif
104+ #ifdef CONFIG_KASAN
105+ { 0 , "kasan shadow mem start" },
106+ { 0 , "kasan shadow mem end" },
103107#endif
104108 { -1 , NULL },
105109};
@@ -323,6 +327,10 @@ static void populate_markers(void)
323327#endif
324328 address_markers [i ++ ].start_address = FIXADDR_START ;
325329 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
326334#endif /* CONFIG_PPC64 */
327335}
328336
You can’t perform that action at this time.
0 commit comments