diff mbox series

kbuild: Allow LTO to be selected with KASAN_HW_TAGS

Message ID 20210308184656.1914947-1-samitolvanen@google.com (mailing list archive)
State New
Headers show
Series kbuild: Allow LTO to be selected with KASAN_HW_TAGS | expand

Commit Message

Sami Tolvanen March 8, 2021, 6:46 p.m. UTC
While LTO with KASAN is normally not useful, hardware tag-based KASAN
can be used also in production kernels with ARM64_MTE. Therefore, allow
KASAN_HW_TAGS to be selected together with HAS_LTO_CLANG.

Reported-by: Alistair Delva <adelva@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 arch/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32

Comments

Kees Cook March 8, 2021, 9:39 p.m. UTC | #1
On Mon, Mar 08, 2021 at 10:46:56AM -0800, Sami Tolvanen wrote:
> While LTO with KASAN is normally not useful, hardware tag-based KASAN
> can be used also in production kernels with ARM64_MTE. Therefore, allow
> KASAN_HW_TAGS to be selected together with HAS_LTO_CLANG.
> 
> Reported-by: Alistair Delva <adelva@google.com>
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

Reviewed-by: Kees Cook <keescook@chromium.org>
Masahiro Yamada March 9, 2021, 5:12 p.m. UTC | #2
On Tue, Mar 9, 2021 at 6:39 AM Kees Cook <keescook@chromium.org> wrote:
>
> On Mon, Mar 08, 2021 at 10:46:56AM -0800, Sami Tolvanen wrote:
> > While LTO with KASAN is normally not useful, hardware tag-based KASAN
> > can be used also in production kernels with ARM64_MTE. Therefore, allow
> > KASAN_HW_TAGS to be selected together with HAS_LTO_CLANG.
> >
> > Reported-by: Alistair Delva <adelva@google.com>
> > Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>
> --
> Kees Cook

Applied to linux-kbuild/fixes. Thanks.
diff mbox series

Patch

diff --git a/arch/Kconfig b/arch/Kconfig
index 2bb30673d8e6..2e7139b39e8f 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -638,7 +638,7 @@  config HAS_LTO_CLANG
 	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
 	depends on ARCH_SUPPORTS_LTO_CLANG
 	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
-	depends on !KASAN
+	depends on !KASAN || KASAN_HW_TAGS
 	depends on !GCOV_KERNEL
 	help
 	  The compiler and Kconfig options support building with Clang's