[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250802004316.GA3910513@ax162>
Date: Fri, 1 Aug 2025 17:43:16 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Kees Cook <kees@...nel.org>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Nicolas Schier <nicolas.schier@...ux.dev>,
linux-kbuild@...r.kernel.org,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] kbuild: Re-enable -Wunterminated-string-initialization
On Fri, Aug 01, 2025 at 05:27:40PM -0700, Kees Cook wrote:
> With the few remaining fixes now landed, we can re-enable the option
> -Wunterminated-string-initialization for GCC. (Clang does not yet fully
> understand the "nonstring" attribute.)
>
> Signed-off-by: Kees Cook <kees@...nel.org>
What else does Clang need? Are bugs filed? I had requested support for
multidimensional arrays, which Aaron implemented pretty quickly (and the
tests seem pretty expansive):
https://github.com/llvm/llvm-project/commit/e8ae77947154e10dbc05cbb95ec9e10d3b0be13e
> ---
> Cc: Masahiro Yamada <masahiroy@...nel.org>
> Cc: Nathan Chancellor <nathan@...nel.org>
> Cc: Nicolas Schier <nicolas.schier@...ux.dev>
> Cc: <linux-kbuild@...r.kernel.org>
> ---
> scripts/Makefile.extrawarn | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index dca175fffcab..7ab8549485a4 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -78,8 +78,10 @@ KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type)
> KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno-stringop-overflow)
> KBUILD_CFLAGS-$(CONFIG_CC_STRINGOP_OVERFLOW) += $(call cc-option, -Wstringop-overflow)
>
> +ifdef CONFIG_CC_IS_CLANG
> # Currently, disable -Wunterminated-string-initialization as broken
> KBUILD_CFLAGS += $(call cc-option, -Wno-unterminated-string-initialization)
> +endif
>
> # The allocators already balk at large sizes, so silence the compiler
> # warnings for bounds checks involving those possible values. While
> --
> 2.34.1
>
Powered by blists - more mailing lists