[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACzwLxia6xMcQ=vsYG7SE+pUO8=4DiRWD_Omq3wzRyuhDjGcPQ@mail.gmail.com>
Date: Thu, 9 Oct 2025 20:59:32 +0500
From: Sabyrzhan Tasbolatov <snovitoll@...il.com>
To: Ritesh Harjani <ritesh.list@...il.com>
Cc: ryabinin.a.a@...il.com, christophe.leroy@...roup.eu, bhe@...hat.com,
hca@...ux.ibm.com, andreyknvl@...il.com, akpm@...ux-foundation.org,
zhangqing@...ngson.cn, chenhuacai@...ngson.cn, davidgow@...gle.com,
glider@...gle.com, dvyukov@...gle.com, alexghiti@...osinc.com, alex@...ti.fr,
agordeev@...ux.ibm.com, vincenzo.frascino@....com, elver@...gle.com,
kasan-dev@...glegroups.com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org,
linux-s390@...r.kernel.org, linux-um@...ts.infradead.org, linux-mm@...ck.org
Subject: Re: [PATCH v6 1/2] kasan: introduce ARCH_DEFER_KASAN and unify static
key across modes
On Thu, Sep 4, 2025 at 5:38 AM Ritesh Harjani <ritesh.list@...il.com> wrote:
>
>
> Only book3s64 needs static keys here because of radix v/s hash mode
> selection during runtime. The changes in above for powerpc looks good to
> me. It's a nice cleanup too.
>
Hello,
Thanks for the review and sorry for the late reply. This has already
been merged.
AFAIU, in arch/powerpc/Kconfig
config PPC
...
select ARCH_NEEDS_DEFER_KASAN if PPC_RADIX_MMU
and in arch/powerpc/platforms/Kconfig.cputype:
config PPC_RADIX_MMU
bool "Radix MMU Support"
depends on PPC_BOOK3S_64
select ARCH_HAS_GIGANTIC_PAGE
default y
So the KASAN static key is enabled only for PPC_BOOK3S_64 by this
Kconfig selection.
In other git changes like:
arch/powerpc/mm/kasan/init_32.c
arch/powerpc/mm/kasan/init_book3e_64.c
, where we call kasan_init_generic() -> kasan_enable() does nothing because
CONFIG_ARCH_DEFER_KASAN is not selected.
> So feel free to take:
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@...il.com> #powerpc
>
> However I have few comments below...
>
> > @@ -246,7 +255,7 @@ static inline void poison_slab_object(struct kmem_cache *cache, void *object,
> > bool __kasan_slab_pre_free(struct kmem_cache *cache, void *object,
> > unsigned long ip)
> > {
> > - if (!kasan_arch_is_ready() || is_kfence_address(object))
> > + if (is_kfence_address(object))
>
> For changes in mm/kasan/common.c.. you have removed !kasan_enabled()
> check at few places. This seems to be partial revert of commit [1]:
>
> b3c34245756ada "kasan: catch invalid free before SLUB reinitializes the object"
>
> Can you please explain why this needs to be removed?
kasan_arch_is_ready() was removed here because in
commit 1e338f4d99e6("kasan: introduce ARCH_DEFER_KASAN and unify
static key across modes")
I've unified the check with kasan_enabled() which is already called in
the __wrapper
__kasan_slab_pre_free in include/linux/kasan.h
> Also the explaination of the same should be added in the commit msg too.
>
> [1]: https://lore.kernel.org/all/20240809-kasan-tsbrcu-v8-1-aef4593f9532@google.com/
>
Powered by blists - more mailing lists