From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Michael Ellerman <mpe@ellerman.id.au>,
Nathan Lynch <nathanl@linux.ibm.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
kasan-dev <kasan-dev@googlegroups.com>
Subject: Re: [PATCH] powerpc/kasan/book3s_64: warn when running with hash MMU
Date: Thu, 6 Oct 2022 05:04:52 +0000 [thread overview]
Message-ID: <9b6eb796-6b40-f61d-b9c6-c2e9ab0ced38@csgroup.eu> (raw)
In-Reply-To: <874jwhpp6g.fsf@mpe.ellerman.id.au>
+ KASAN list
Le 06/10/2022 à 06:10, Michael Ellerman a écrit :
> Nathan Lynch <nathanl@linux.ibm.com> writes:
>> kasan is known to crash at boot on book3s_64 with non-radix MMU. As
>> noted in commit 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only
>> KASAN support"):
>>
>> A kernel with CONFIG_KASAN=y will crash during boot on a machine
>> using HPT translation because not all the entry points to the
>> generic KASAN code are protected with a call to kasan_arch_is_ready().
>
> I guess I thought there was some plan to fix that.
I was thinking the same.
Do we have a list of the said entry points to the generic code that are
lacking a call to kasan_arch_is_ready() ?
Typically, the BUG dump below shows that kasan_byte_accessible() is
lacking the check. It should be straight forward to add
kasan_arch_is_ready() check to kasan_byte_accessible(), shouldn't it ?
>
> But maybe I'm misremembering. Looking now it's not entirely straight
> forward with the way the headers are structured. So I guess I'm wrong
> about that.
>
>> Such crashes look like this:
>>
>> BUG: Unable to handle kernel data access at 0xc00e00000308b100
>> Faulting instruction address: 0xc0000000006d0fcc
>> Oops: Kernel access of bad area, sig: 11 [#1]
>> LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
>> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.0.0-rc5-02183-g3ab165dea2a2 #13
>> [...regs...]
>> NIP [c0000000006d0fcc] kasan_byte_accessible+0xc/0x20
>> LR [c0000000006cd9cc] __kasan_check_byte+0x2c/0xa0
>> Call Trace:
...
>>
>> Change init_book3s_64.c::kasan_init() to emit a warning backtrace and
>> taint the kernel when not running on radix. When the kernel likely
>> oopses later, the 'W' taint flag in the report should help minimize
>> developer time spent trying to understand what's gone wrong.
>
> Should we just panic() directly?
But then you loose any sight that the problem is in
kasan_byte_accessible() and have to be fixed there.
Christophe
next prev parent reply other threads:[~2022-10-06 5:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 22:37 [PATCH] powerpc/kasan/book3s_64: warn when running with hash MMU Nathan Lynch
2022-10-06 4:10 ` Michael Ellerman
2022-10-06 5:04 ` Christophe Leroy [this message]
2022-10-07 10:41 ` Michael Ellerman
2022-10-10 14:10 ` Nathan Lynch
2022-10-10 17:03 ` Christophe Leroy
2022-10-11 10:00 ` Michael Ellerman
2022-10-11 10:25 ` Christophe Leroy
2023-01-26 7:11 ` Christophe Leroy
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=9b6eb796-6b40-f61d-b9c6-c2e9ab0ced38@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=kasan-dev@googlegroups.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nathanl@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).