[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2360000f-7292-9da8-d6b5-94b125c5f2b0@loongson.cn>
Date: Thu, 30 Mar 2023 12:32:53 +0800
From: Qing Zhang <zhangqing@...ngson.cn>
To: Andrey Konovalov <andreyknvl@...il.com>
Cc: Jonathan Corbet <corbet@....net>,
Huacai Chen <chenhuacai@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
WANG Xuerui <kernel@...0n.name>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
kasan-dev@...glegroups.com, linux-doc@...r.kernel.org,
linux-mm@...ck.org, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org,
Andrey Ryabinin <ryabinin.a.a@...il.com>
Subject: Re: [PATCH] LoongArch: Add kernel address sanitizer support
On 2023/3/30 上午10:55, Andrey Konovalov wrote:
> On Thu, Mar 30, 2023 at 4:06 AM Qing Zhang <zhangqing@...ngson.cn> wrote:
>>
>>> But I don't think you need this check here at all: addr_has_metadata
>>> already checks that shadow exists.
>>>
>> On LongArch, there's a lot of holes between different segments, so kasan
>> shadow area is some different type of memory that we concatenate, we
>> can't use if (unlikely((void *)addr <
>> kasan_shadow_to_mem((void *)KASAN_SHADOW_START))) to determine the
>> validity, and in arch/loongarch/include/asm/kasan.h I construct invalid
>> NULL.
>
> I get that, but you already added a special case for
> __HAVE_ARCH_SHADOW_MAP to addr_has_metadata, so you can just call it?
>
ok, all the changes are going to be in v2.
Thanks,
-Qing
>> This is because in pagetable_init on loongarch/mips, we populate pmd/pud
>> with invalid_pmd_table/invalid_pud_table,
>
> I see. Please add this into the patch description for v2.
>
>> So pmd_init/pud_init(p) is required, perhaps we define them as __weak in
>> mm/kasan/init.c, like mm/sparse-vmemmap.c.
>
> Yes, this makes sense to do, so that KASAN doesn't depend on
> definitions from sparse-vmemmap.c.
>
> Thank you!
>
Powered by blists - more mailing lists