mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hailong liu <carver4lio@163.com>
To: Russell King <linux@armlinux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mike Rapoport <rppt@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com,
	Hailong Liu <liu.hailong6@zte.com.cn>
Subject: [RESEND PATCH v2] arm/mm/ptdump:Add address markers for KASAN regions
Date: Wed, 20 Jan 2021 20:50:10 +0800	[thread overview]
Message-ID: <20210120125010.10896-1-carver4lio@163.com> (raw)

From: Hailong Liu <liu.hailong6@zte.com.cn>

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

I have tested this patch 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 ]---

v2:
- fix the puzzling subject and the description due to my
carelessness.

Signed-off-by: Hailong Liu <liu.hailong6@zte.com.cn>
---
 arch/arm/mm/dump.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c
index c18d23a5e5f1..93ff0097f00b 100644
--- a/arch/arm/mm/dump.c
+++ b/arch/arm/mm/dump.c
@@ -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 = {
-- 
2.17.1



             reply	other threads:[~2021-01-20 14:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 12:50 Hailong liu [this message]
2021-01-21  8:36 ` Linus Walleij
2021-01-26 14:38   ` carver4lio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210120125010.10896-1-carver4lio@163.com \
    --to=carver4lio@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=liu.hailong6@zte.com.cn \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®