linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@gmail.com>
To: Baoquan He <bhe@redhat.com>
Cc: linux-mm@kvack.org, ryabinin.a.a@gmail.com, glider@google.com,
	 dvyukov@google.com, vincenzo.frascino@arm.com,
	akpm@linux-foundation.org,  kasan-dev@googlegroups.com,
	linux-kernel@vger.kernel.org,  kexec@lists.infradead.org,
	elver@google.com, sj@kernel.org,  lorenzo.stoakes@oracle.com,
	snovitoll@gmail.com, christophe.leroy@csgroup.eu
Subject: Re: [PATCH v4 12/12] mm/kasan: make kasan=on|off take effect for all three modes
Date: Thu, 4 Dec 2025 17:40:48 +0100	[thread overview]
Message-ID: <CA+fCnZfw5V4HqHepJUbH5cFSEj1G4yvJMb=1Tjd_7WDBP7uUfQ@mail.gmail.com> (raw)
In-Reply-To: <20251128033320.1349620-13-bhe@redhat.com>

On Fri, Nov 28, 2025 at 4:35 AM 'Baoquan He' via kasan-dev
<kasan-dev@googlegroups.com> wrote:
>
> Now everything is ready, set kasan=off can disable kasan for all
> three modes.
>
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  include/linux/kasan-enabled.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/kasan-enabled.h b/include/linux/kasan-enabled.h
> index b05ec6329fbe..b33c92cc6bd8 100644
> --- a/include/linux/kasan-enabled.h
> +++ b/include/linux/kasan-enabled.h
> @@ -4,6 +4,7 @@
>
>  #include <linux/static_key.h>
>
> +#ifdef CONFIG_KASAN
>  extern bool kasan_arg_disabled;
>
>  /*
> @@ -12,7 +13,6 @@ extern bool kasan_arg_disabled;
>   */
>  DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
>
> -#if defined(CONFIG_ARCH_DEFER_KASAN) || defined(CONFIG_KASAN_HW_TAGS)

So do we still need CONFIG_ARCH_DEFER_KASAN? If not, it needs to be removed.

But if we only allow kasan=off for x86/arm64 after all (see my comment
to the cover letter), I believe we need to keep it.


>  /*
>   * Runtime control for shadow memory initialization or HW_TAGS mode.
>   * Uses static key for architectures that need deferred KASAN or HW_TAGS.
> @@ -30,7 +30,7 @@ static inline void kasan_enable(void)
>  /* For architectures that can enable KASAN early, use compile-time check. */
>  static __always_inline bool kasan_enabled(void)
>  {
> -       return IS_ENABLED(CONFIG_KASAN);
> +       return false;
>  }
>
>  static inline void kasan_enable(void) {}
> --
> 2.41.0
>
> --
> You received this message because you are subscribed to the Google Groups "kasan-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/kasan-dev/20251128033320.1349620-13-bhe%40redhat.com.


  parent reply	other threads:[~2025-12-04 16:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28  3:33 [PATCH v4 00/12] mm/kasan: make kasan=on|off work " Baoquan He
2025-11-28  3:33 ` [PATCH v4 01/12] mm/kasan: add conditional checks in functions to return directly if kasan is disabled Baoquan He
2025-12-04 16:38   ` Andrey Konovalov
2025-12-05  7:20     ` Baoquan He
2025-12-05 15:07       ` Andrey Konovalov
2025-11-28  3:33 ` [PATCH v4 02/12] mm/kasan: move kasan= code to common place Baoquan He
2025-12-04 16:39   ` Andrey Konovalov
2025-11-28  3:33 ` [PATCH v4 03/12] mm/kasan/sw_tags: don't initialize kasan if it's disabled Baoquan He
2025-12-04 16:40   ` Andrey Konovalov
2025-11-28  3:33 ` [PATCH v4 04/12] arch/arm: " Baoquan He
2025-11-28  3:33 ` [PATCH v4 05/12] arch/arm64: " Baoquan He
2025-11-28  3:33 ` [PATCH v4 06/12] arch/loongarch: " Baoquan He
2025-11-28  3:33 ` [PATCH v4 07/12] arch/powerpc: " Baoquan He
2025-11-28  3:33 ` [PATCH v4 08/12] arch/riscv: " Baoquan He
2025-11-28  3:33 ` [PATCH v4 09/12] arch/x86: " Baoquan He
2025-11-28  3:33 ` [PATCH v4 10/12] arch/xtensa: " Baoquan He
2025-11-28  3:33 ` [PATCH v4 11/12] arch/um: " Baoquan He
2025-12-01 10:56   ` Johannes Berg
2025-12-02 13:13     ` Baoquan He
2025-11-28  3:33 ` [PATCH v4 12/12] mm/kasan: make kasan=on|off take effect for all three modes Baoquan He
2025-11-28 15:50   ` Alexander Potapenko
2025-11-30  2:49     ` Baoquan He
2025-12-04 16:40   ` Andrey Konovalov [this message]
2025-12-04 16:38 ` [PATCH v4 00/12] mm/kasan: make kasan=on|off work " Andrey Konovalov
2025-12-05  7:14   ` Baoquan He
2025-12-05 11:03     ` Heiko Carstens
2025-12-05 12:57       ` Baoquan He
2025-12-05 15:07     ` Andrey Konovalov

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+fCnZfw5V4HqHepJUbH5cFSEj1G4yvJMb=1Tjd_7WDBP7uUfQ@mail.gmail.com' \
    --to=andreyknvl@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=sj@kernel.org \
    --cc=snovitoll@gmail.com \
    --cc=vincenzo.frascino@arm.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