[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220213160656.17605-1-lecopzer.chen@mediatek.com>
Date: Mon, 14 Feb 2022 00:06:56 +0800
From: Lecopzer Chen <lecopzer.chen@...iatek.com>
To: <linus.walleij@...aro.org>
CC: <andreyknvl@...il.com>, <anshuman.khandual@....com>,
<ardb@...nel.org>, <arnd@...db.de>, <dvyukov@...gle.com>,
<geert+renesas@...der.be>, <glider@...gle.com>,
<kasan-dev@...glegroups.com>, <lecopzer.chen@...iatek.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <linux@...linux.org.uk>,
<lukas.bulwahn@...il.com>, <mark.rutland@....com>,
<masahiroy@...nel.org>, <matthias.bgg@...il.com>,
<rmk+kernel@...linux.org.uk>, <ryabinin.a.a@...il.com>,
<yj.chiang@...iatek.com>
Subject: Re: [PATCH v2 1/2] arm: kasan: support CONFIG_KASAN_VMALLOC
Hi Linus
Thanks for your review.
> > - kasan_populate_early_shadow(kasan_mem_to_shadow((void *)VMALLOC_START),
> > + if (!IS_ENABLED(CONFIG_KASAN_VMALLOC))
> > + kasan_populate_early_shadow(kasan_mem_to_shadow((void *)VMALLOC_START),
> > + kasan_mem_to_shadow((void *)VMALLOC_END));
> > +
> > + kasan_populate_early_shadow(kasan_mem_to_shadow((void *)VMALLOC_END),
> > kasan_mem_to_shadow((void *)-1UL) + 1);
>
> Where is this actually mapped?
>
> Can you print out where
> kasan_mem_to_shadow((void *)VMALLOC_START)
> kasan_mem_to_shadow((void *)VMALLOC_END)
> as well as KASAN_SHADOW_START and KASAN_SHADOW_END
> points?
>
> When I looked into this getting the shadow memory between
> KASAN_SHADOW_START and KASAN_SHADOW_END
> seemed like the big problem since this is static, so how is Kasan
> solving this now?
For quick answer:
As I knwon, the definition of KASAN_SHADOW_START and END
(@arch/arm/include/asm/kasan_def.h)
* 1) KASAN_SHADOW_START
* This value begins with the MODULE_VADDR's shadow address. It is the
* start of kernel virtual space....
*
* 2) KASAN_SHADOW_END
* This value is the 0x100000000's shadow address: the mapping that would
* be after the end of the kernel memory at 0xffffffff....
and the virt address of vmalloc for ARM32 is also between MODULE_VADDR and
0x100000000 (ZONE_HIGHMEM), so nothing needs to do.
If there is any cases may break this assumption, please correct me, thanks.
>
> Please patch the picture in
> include/asm/kasan_def.h
> and the info in
> Documentation/arm/memory.rst
> so it clearly reflects where VMALLOC is shadowed.
Thanks for suggestion, Yes, we really do need to update doc for memory layout.
I'll study how to add it and provide in v3.
Powered by blists - more mailing lists