Skip to content

[PW_SID:1057600] mm/kasan: make kasan=on|off work for all three modes#1497

Open
linux-riscv-bot wants to merge 15 commits intoworkflow__riscv__fixesfrom
pw1057600
Open

[PW_SID:1057600] mm/kasan: make kasan=on|off work for all three modes#1497
linux-riscv-bot wants to merge 15 commits intoworkflow__riscv__fixesfrom
pw1057600

Conversation

@linux-riscv-bot
Copy link

PR for series 1057600 applied to workflow__riscv__fixes

Name: mm/kasan: make kasan=on|off work for all three modes
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1057600
Version: 5

Baoquan He added 15 commits February 25, 2026 08:46
…asan is disabled

The current codes only check if kasan is disabled for hw_tags
mode. Here add the conditional checks for functional functions of
generic mode and sw_tags mode.

And also add a helper __kasan_cache_shrink() in mm/kasan/generic.c
so that the conditional check is done in include/linux/kasan.h.

This is prepared for later adding kernel parameter kasan=on|off for
all three kasan modes.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
And change it to be a bool variable. This is prepared for later
usage.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
This allows generic and sw_tags to be set in kernel cmdline too.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Now everything is ready, setting kasan=off can disable kasan for all
three modes.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

And also call jump_label_init() early in setup_arch() so that later
kasan_init() can enable static key kasan_flag_enabled. Put
jump_label_init() beofre parse_early_param() as other architectures
do.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

And also need skip kasan_populate_early_vm_area_shadow() if kasan
is disabled.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: loongarch@lists.linux.dev
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

This includes 32bit, book3s/64 and book3e/64.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: linux-riscv@lists.infradead.org
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: x86@kernel.org
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

And also call jump_label_init() early in setup_arch() so that later
kasan_init() can enable static key kasan_flag_enabled. Put
jump_label_init() beofre parse_early_param() as other architectures
do.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Here, kasan is disabled if specified 'kasan=off' in kernel cmdline.

And also wrap up the kasan code into CONFIG_KASAN ifdeffery scope.

Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: linux-um@lists.infradead.org
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
And also remove the relevant description in dev-tools/kasan.rst
which is hw_tags specificially.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Since commit 1e338f4 ("kasan: introduce ARCH_DEFER_KASAN and unify
static key across modes"), kasan_arch_is_ready() has been dead code.
And up to now, ARCH_DEFER_KASAN is useless too because of code change
for 'kasan=on|off'.

Here clean them up.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.70 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2156.09 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2939.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.98 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.66 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v5,01/15] mm/kasan: add conditional checks in functions to return directly if kasan is disabled"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v5,02/15] mm/kasan: rename 'kasan_arg' to 'kasan_arg_disabled'"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v5,02/15] mm/kasan: rename 'kasan_arg' to 'kasan_arg_disabled'"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 998.94 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v5,02/15] mm/kasan: rename 'kasan_arg' to 'kasan_arg_disabled'"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1347.10 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[v5,09/15] arch/powerpc: don't initialize kasan if it's disabled"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[v5,09/15] arch/powerpc: don't initialize kasan if it's disabled"
kdoc
Desc: Detects for kdoc errors
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[v5,09/15] arch/powerpc: don't initialize kasan if it's disabled"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[v5,09/15] arch/powerpc: don't initialize kasan if it's disabled"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[v5,09/15] arch/powerpc: don't initialize kasan if it's disabled"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.61 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1117.62 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1640.07 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.78 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.00 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.85 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.55 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[v5,10/15] arch/riscv: don't initialize kasan if it's disabled"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 138.09 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1007.80 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1357.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.06 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.66 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
kdoc
Desc: Detects for kdoc errors
Duration: 0.82 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[v5,11/15] arch/x86: don't initialize kasan if it's disabled"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 12: "[v5,12/15] arch/xtensa: don't initialize kasan if it's disabled"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.07 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant