[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+fCnZf3k-rsaOeti0Q7rqkmvsqDb2XxgxOq6V5Gqp6FGLH7Yg@mail.gmail.com>
Date: Thu, 9 Feb 2023 23:54:24 +0100
From: Andrey Konovalov <andreyknvl@...il.com>
To: Dmitry Vyukov <dvyukov@...gle.com>,
袁帅(Shuai Yuan) <yuanshuai@...u.com>
Cc: 欧阳炜钊(Weizhao Ouyang)
<ouyangweizhao@...u.com>, Andrey Ryabinin <ryabinin.a.a@...il.com>,
Alexander Potapenko <glider@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
"kasan-dev@...glegroups.com" <kasan-dev@...glegroups.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Weizhao Ouyang <o451686892@...il.com>,
任立鹏(Peng Ren) <renlipeng@...u.com>
Subject: Re: [PATCH v2] kasan: fix deadlock in start_report()
On Thu, Feb 9, 2023 at 11:44 AM Dmitry Vyukov <dvyukov@...gle.com> wrote:
>
> On Thu, 9 Feb 2023 at 10:19, 袁帅(Shuai Yuan) <yuanshuai@...u.com> wrote:
> >
> > Hi Dmitry Vyukov
> >
> > Thanks, I see that your means.
> >
> > Currently, report_suppressed() seem not work in Kasan-HW mode, it always return false.
> > Do you think should change the report_suppressed function?
> > I don't know why CONFIG_KASAN_HW_TAGS was blocked separately before.
>
> That logic was added by Andrey in:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c068664c97c7cf
>
> Andrey, can we make report_enabled() check current->kasan_depth and
> remove report_suppressed()?
I decided to not use kasan_depth for HW_TAGS, as we can always use a
match-all tag to make "invalid" memory accesses.
I think we can fix the reporting code to do exactly that so that it
doesn't cause MTE faults.
Shuai, could you clarify, at which point due kasan_report_invalid_free
an MTE exception is raised in your tests?
> Then we can also remove the comment in kasan_report_invalid_free().
>
> It looks like kasan_disable_current() in kmemleak needs to affect
> HW_TAGS mode as well:
> https://elixir.bootlin.com/linux/v6.2-rc7/source/mm/kmemleak.c#L301
It uses kasan_reset_tag, so it should work properly with HW_TAGS.
Powered by blists - more mailing lists