From: Kees Cook <kees@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Nicolas Schier <nicolas.schier@linux.dev>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, stable@vger.kernel.org
Subject: Re: [PATCH] kbuild: Add '-fno-builtin-wcslen'
Date: Tue, 8 Apr 2025 16:33:42 -0700 [thread overview]
Message-ID: <202504081632.00837E7921@keescook> (raw)
In-Reply-To: <20250407-fno-builtin-wcslen-v1-1-6775ce759b15@kernel.org>
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@vger.kernel.org
> Link: https://github.com/llvm/llvm-project/commit/9694844d7e36fd5e01011ab56b64f27b867aa72d [1]
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Thanks for chasing this down. :)
Reviewed-by: Kees Cook <kees@kernel.org>
Since I have stuff queued for -rc2, do you want me to snag this too?
--
Kees Cook
next prev parent reply other threads:[~2025-04-08 23:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 23:22 Nathan Chancellor
2025-04-08 23:33 ` Kees Cook [this message]
2025-04-09 0:14 ` Linus Torvalds
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=202504081632.00837E7921@keescook \
--to=kees@kernel.org \
--cc=justinstitt@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=masahiroy@kernel.org \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=nicolas.schier@linux.dev \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®