[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202504081632.00837E7921@keescook>
Date: Tue, 8 Apr 2025 16:33:42 -0700
From: Kees Cook <kees@...nel.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Nicolas Schier <nicolas.schier@...ux.dev>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
stable@...r.kernel.org
Subject: Re: [PATCH] kbuild: Add '-fno-builtin-wcslen'
On Mon, Apr 07, 2025 at 04:22:12PM -0700, Nathan Chancellor wrote:
> A recent optimization change in LLVM [1] aims to transform certain loop
> idioms into calls to strlen() or wcslen(). This change transforms the
> first while loop in UniStrcat() into a call to wcslen(), breaking the
> build when UniStrcat() gets inlined into alloc_path_with_tree_prefix():
>
> ld.lld: error: undefined symbol: wcslen
> >>> referenced by nls_ucs2_utils.h:54 (fs/smb/client/../../nls/nls_ucs2_utils.h:54)
> >>> vmlinux.o:(alloc_path_with_tree_prefix)
> >>> referenced by nls_ucs2_utils.h:54 (fs/smb/client/../../nls/nls_ucs2_utils.h:54)
> >>> vmlinux.o:(alloc_path_with_tree_prefix)
>
> Disable this optimization with '-fno-builtin-wcslen', which prevents the
> compiler from assuming that wcslen() is available in the kernel's C
> library
>
> Cc: stable@...r.kernel.org
> Link: https://github.com/llvm/llvm-project/commit/9694844d7e36fd5e01011ab56b64f27b867aa72d [1]
> Signed-off-by: Nathan Chancellor <nathan@...nel.org>
Thanks for chasing this down. :)
Reviewed-by: Kees Cook <kees@...nel.org>
Since I have stuff queued for -rc2, do you want me to snag this too?
--
Kees Cook
Powered by blists - more mailing lists