From: Heiko Carstens <hca@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>
Cc: Sabyrzhan Tasbolatov <snovitoll@gmail.com>,
ryabinin.a.a@gmail.com, glider@google.com, andreyknvl@gmail.com,
dvyukov@google.com, vincenzo.frascino@arm.com,
linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org,
chenhuacai@kernel.org, kernel@xen0n.name, maddy@linux.ibm.com,
mpe@ellerman.id.au, npiggin@gmail.com,
christophe.leroy@csgroup.eu, paul.walmsley@sifive.com,
palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
gor@linux.ibm.com, borntraeger@linux.ibm.com,
svens@linux.ibm.com, richard@nod.at,
anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net,
dave.hansen@linux.intel.com, luto@kernel.org,
peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, x86@kernel.org, hpa@zytor.com, chris@zankel.net,
jcmvbkbc@gmail.com, akpm@linux-foundation.org, nathan@kernel.org,
nick.desaulniers+lkml@gmail.com, morbo@google.com,
justinstitt@google.com, arnd@arndb.de, rppt@kernel.org,
geert@linux-m68k.org, mcgrof@kernel.org,
guoweikang.kernel@gmail.com, tiwei.btw@antgroup.com,
kevin.brodsky@arm.com, benjamin.berg@intel.com,
kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
linux-s390@vger.kernel.org, linux-um@lists.infradead.org,
linux-mm@kvack.org, llvm@lists.linux.dev
Subject: Re: [PATCH v2 01/11] kasan: unify static kasan_flag_enabled across modes
Date: Mon, 30 Jun 2025 16:39:34 +0200 [thread overview]
Message-ID: <20250630143934.15284Caf-hca@linux.ibm.com> (raw)
In-Reply-To: <aGKDhPBgDv2JjJZr@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
On Mon, Jun 30, 2025 at 02:31:00PM +0200, Alexander Gordeev wrote:
> On Thu, Jun 26, 2025 at 08:31:37PM +0500, Sabyrzhan Tasbolatov wrote:
>
> Hi Sabyrzhan,
>
> > diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
> > index d54e89f8c3e..32c432df24a 100644
> > --- a/mm/kasan/generic.c
> > +++ b/mm/kasan/generic.c
> > @@ -36,6 +36,17 @@
> > #include "kasan.h"
> > #include "../slab.h"
> >
> > +/*
> > + * Initialize Generic KASAN and enable runtime checks.
> > + * This should be called from arch kasan_init() once shadow memory is ready.
> > + */
> > +void __init kasan_init_generic(void)
> > +{
> > + static_branch_enable(&kasan_flag_enabled);
>
> s390 crashes at this line, when the whole series is applied.
>
> FWIW, it looks like kasan is called while its state is not yet finalized.
> E.g. whether calling __asan_report_store4_noabort() before kasan_init_generic()
> is expected?
It crashes because with this conversion a call to static_branch_enable() is
introduced. This one get's called way before jump_label_init() init has been
called. Therefore the STATIC_KEY_CHECK_USE() in static_key_enable_cpuslocked()
triggers.
This again tries to emit a warning. Due to lack of console support that early
the kernel crashes.
One possible solution would be to move the kasan init function to
arch/s390/kernel/setup.c, after jump_label_init() has been called.
If we want this, is a different question.
It seems to work, so I see no reason for not doing that.
Vasily, since you did nearly all of the KASAN work for s390, do you have any
opinion about this?
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-06-30 15:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 15:31 [PATCH v2 00/11] kasan: unify kasan_arch_is_ready with kasan_enabled Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 01/11] kasan: unify static kasan_flag_enabled across modes Sabyrzhan Tasbolatov
2025-06-30 12:31 ` Alexander Gordeev
2025-06-30 14:39 ` Heiko Carstens [this message]
2025-06-30 15:23 ` Alexander Gordeev
2025-07-01 0:05 ` Andrew Morton
2025-06-26 15:31 ` [PATCH v2 02/11] kasan/arm64: call kasan_init_generic in kasan_init Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 03/11] kasan/arm: " Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 04/11] kasan/xtensa: " Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 05/11] kasan/loongarch: " Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 06/11] kasan/um: " Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 07/11] kasan/x86: " Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 08/11] kasan/s390: " Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 09/11] kasan/powerpc: " Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 10/11] kasan/riscv: " Sabyrzhan Tasbolatov
2025-06-26 15:31 ` [PATCH v2 11/11] kasan: replace kasan_arch_is_ready with kasan_enabled Sabyrzhan Tasbolatov
2025-06-28 10:56 ` [PATCH v2 00/11] kasan: unify " Andrey Konovalov
2025-06-28 13:25 ` Sabyrzhan Tasbolatov
2025-06-29 20:05 ` Andrey Konovalov
2025-07-01 10:15 ` Heiko Carstens
2025-07-01 10:25 ` Christophe Leroy
2025-07-01 13:37 ` Heiko Carstens
2025-06-28 11:26 ` 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=20250630143934.15284Caf-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=andreyknvl@gmail.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=benjamin.berg@intel.com \
--cc=borntraeger@linux.ibm.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=chris@zankel.net \
--cc=christophe.leroy@csgroup.eu \
--cc=dave.hansen@linux.intel.com \
--cc=dvyukov@google.com \
--cc=geert@linux-m68k.org \
--cc=glider@google.com \
--cc=gor@linux.ibm.com \
--cc=guoweikang.kernel@gmail.com \
--cc=hpa@zytor.com \
--cc=jcmvbkbc@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=justinstitt@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kernel@xen0n.name \
--cc=kevin.brodsky@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=llvm@lists.linux.dev \
--cc=loongarch@lists.linux.dev \
--cc=luto@kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mcgrof@kernel.org \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=mpe@ellerman.id.au \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=npiggin@gmail.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterz@infradead.org \
--cc=richard@nod.at \
--cc=rppt@kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=snovitoll@gmail.com \
--cc=svens@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=tiwei.btw@antgroup.com \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/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