From: Andrey Konovalov <andreyknvl@gmail.com>
To: Qing Zhang <zhangqing@loongson.cn>
Cc: Jonathan Corbet <corbet@lwn.net>,
Huacai Chen <chenhuacai@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Alexander Potapenko <glider@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
WANG Xuerui <kernel@xen0n.name>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
kasan-dev@googlegroups.com, linux-doc@vger.kernel.org,
linux-mm@kvack.org, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
Andrey Ryabinin <ryabinin.a.a@gmail.com>
Subject: Re: [PATCH] LoongArch: Add kernel address sanitizer support
Date: Thu, 30 Mar 2023 04:55:57 +0200 [thread overview]
Message-ID: <CA+fCnZddt50+10SZ+hZRKBudsmMF0W9XpsDG6=58p1ot62LjXQ@mail.gmail.com> (raw)
In-Reply-To: <dccfbff3-7bad-de33-4d96-248bdff44a8b@loongson.cn>
On Thu, Mar 30, 2023 at 4:06 AM Qing Zhang <zhangqing@loongson.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?
> 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!
next prev parent reply other threads:[~2023-03-30 2:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 11:17 Qing Zhang
2023-03-28 11:39 ` Xi Ruoyao
2023-03-28 12:15 ` Qing Zhang
2023-03-29 0:22 ` Huacai Chen
2023-03-29 2:01 ` Qing Zhang
2023-03-28 11:57 ` Youling Tang
2023-03-28 12:08 ` Youling Tang
2023-03-28 12:27 ` Qing Zhang
2023-03-29 19:02 ` Andrey Konovalov
2023-03-30 2:06 ` Qing Zhang
2023-03-30 2:55 ` Andrey Konovalov [this message]
2023-03-30 4:32 ` Qing Zhang
2023-03-31 15:58 ` Andrey Konovalov
2023-04-01 3:23 ` Qing Zhang
2023-03-30 6:50 ` Youling Tang
2023-03-30 8:53 ` Qing Zhang
2023-03-31 8:07 ` Youling Tang
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='CA+fCnZddt50+10SZ+hZRKBudsmMF0W9XpsDG6=58p1ot62LjXQ@mail.gmail.com' \
--to=andreyknvl@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chenhuacai@kernel.org \
--cc=corbet@lwn.net \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=jiaxun.yang@flygoat.com \
--cc=kasan-dev@googlegroups.com \
--cc=kernel@xen0n.name \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=loongarch@lists.linux.dev \
--cc=ryabinin.a.a@gmail.com \
--cc=vincenzo.frascino@arm.com \
--cc=zhangqing@loongson.cn \
/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