2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-28 23:23:55 +08:00

ARM: 9053/1: arm/mm/ptdump:Add address markers for KASAN regions

ARM has recently supported KASAN, so I think that it's time to add
KASAN regions for PTDUMP on ARM.

This patch has been tested with QEMU + vexpress-a15. Both
CONFIG_ARM_LPAE and no CONFIG_ARM_LPAE.

The result after patching looks like this:
 ---[ Kasan shadow start ]---
 0x6ee00000-0x7af00000         193M     RW NX SHD MEM/CACHED/WBWA
 0x7b000000-0x7f000000          64M     ro NX SHD MEM/CACHED/WBWA
 ---[ Kasan shadow end ]---
 ---[ Modules ]---
 ---[ Kernel Mapping ]---
	......
 ---[ vmalloc() Area ]---
	......
 ---[ vmalloc() End ]---
 ---[ Fixmap Area ]---
 ---[ Vectors ]---
 	......
 ---[ Vectors End ]---

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Hailong liu <liu.hailong6@zte.com.cn>
Signed-off-by: Hailong liu <carver4lio@163.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
This commit is contained in:
Hailong Liu 2021-01-25 14:56:16 +01:00 committed by Russell King
parent c9c5c23b77
commit b53a9edcde

View File

@ -19,6 +19,10 @@
#include <asm/ptdump.h>
static struct addr_marker address_markers[] = {
#ifdef CONFIG_KASAN
{ KASAN_SHADOW_START, "Kasan shadow start"},
{ KASAN_SHADOW_END, "Kasan shadow end"},
#endif
{ MODULES_VADDR, "Modules" },
{ PAGE_OFFSET, "Kernel Mapping" },
{ 0, "vmalloc() Area" },
@ -429,8 +433,11 @@ static void ptdump_initialize(void)
if (pg_level[i].bits[j].nx_bit)
pg_level[i].nx_bit = &pg_level[i].bits[j];
}
#ifdef CONFIG_KASAN
address_markers[4].start_address = VMALLOC_START;
#else
address_markers[2].start_address = VMALLOC_START;
#endif
}
static struct ptdump_info kernel_ptdump_info = {