* [RESEND PATCH v2] arm/mm/ptdump:Add address markers for KASAN regions
@ 2021-01-20 12:50 ` Hailong liu
0 siblings, 0 replies; 6+ messages in thread
From: Hailong liu @ 2021-01-20 12:50 UTC (permalink / raw)
To: Russell King
Cc: Andrew Morton, Mike Rapoport, Linus Walleij, Andrey Ryabinin,
Alexander Potapenko, Dmitry Vyukov, linux-arm-kernel,
linux-kernel, kasan-dev, Hailong Liu
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RESEND PATCH v2] arm/mm/ptdump:Add address markers for KASAN regions
@ 2021-01-20 12:50 ` Hailong liu
0 siblings, 0 replies; 6+ messages in thread
From: Hailong liu @ 2021-01-20 12:50 UTC (permalink / raw)
To: Russell King
Cc: linux-arm-kernel, Linus Walleij, linux-kernel, kasan-dev,
Alexander Potapenko, Mike Rapoport, Andrey Ryabinin,
Andrew Morton, Hailong Liu, Dmitry Vyukov
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH v2] arm/mm/ptdump:Add address markers for KASAN regions
2021-01-20 12:50 ` Hailong liu
@ 2021-01-21 8:36 ` Linus Walleij
-1 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-01-21 8:36 UTC (permalink / raw)
To: Hailong liu
Cc: Russell King, Andrew Morton, Mike Rapoport, Andrey Ryabinin,
Alexander Potapenko, Dmitry Vyukov, Linux ARM, linux-kernel,
kasan-dev, Hailong Liu
On Wed, Jan 20, 2021 at 1:54 PM Hailong liu <carver4lio@163.com> wrote:
> 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>
Looks correct!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Please put this into Russell's patch tracker.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH v2] arm/mm/ptdump:Add address markers for KASAN regions
@ 2021-01-21 8:36 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-01-21 8:36 UTC (permalink / raw)
To: Hailong liu
Cc: Linux ARM, Hailong Liu, Russell King, kasan-dev, linux-kernel,
Alexander Potapenko, Mike Rapoport, Andrey Ryabinin,
Andrew Morton, Dmitry Vyukov
On Wed, Jan 20, 2021 at 1:54 PM Hailong liu <carver4lio@163.com> wrote:
> 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>
Looks correct!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Please put this into Russell's patch tracker.
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH v2] arm/mm/ptdump:Add address markers for KASAN regions
2021-01-21 8:36 ` Linus Walleij
@ 2021-01-26 14:38 ` carver4lio
-1 siblings, 0 replies; 6+ messages in thread
From: carver4lio @ 2021-01-26 14:38 UTC (permalink / raw)
To: Linus Walleij
Cc: Russell King, Andrew Morton, Mike Rapoport, Andrey Ryabinin,
Alexander Potapenko, Dmitry Vyukov, Linux ARM, linux-kernel,
kasan-dev, Hailong Liu
On 1/21/21 4:36 PM, Linus Walleij wrote:
> On Wed, Jan 20, 2021 at 1:54 PM Hailong liu <carver4lio@163.com> wrote:
>
>> 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>
>
> Looks correct!
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Please put this into Russell's patch tracker.
I have put this patch into Russell's patch tracker, and its status now is
incoming.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH v2] arm/mm/ptdump:Add address markers for KASAN regions
@ 2021-01-26 14:38 ` carver4lio
0 siblings, 0 replies; 6+ messages in thread
From: carver4lio @ 2021-01-26 14:38 UTC (permalink / raw)
To: Linus Walleij
Cc: Linux ARM, Hailong Liu, Russell King, kasan-dev, linux-kernel,
Alexander Potapenko, Mike Rapoport, Andrey Ryabinin,
Andrew Morton, Dmitry Vyukov
On 1/21/21 4:36 PM, Linus Walleij wrote:
> On Wed, Jan 20, 2021 at 1:54 PM Hailong liu <carver4lio@163.com> wrote:
>
>> 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>
>
> Looks correct!
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Please put this into Russell's patch tracker.
I have put this patch into Russell's patch tracker, and its status now is
incoming.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-01-26 14:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 12:50 [RESEND PATCH v2] arm/mm/ptdump:Add address markers for KASAN regions Hailong liu
2021-01-20 12:50 ` Hailong liu
2021-01-21 8:36 ` Linus Walleij
2021-01-21 8:36 ` Linus Walleij
2021-01-26 14:38 ` carver4lio
2021-01-26 14:38 ` carver4lio
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.