From: Herbert Xu <herbert@gondor.apana.org.au>
To: Kees Cook <kees@kernel.org>
Cc: Taehee Yoo <ap420073@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
linux-crypto@vger.kernel.org, llvm@lists.linux.dev,
kernel test robot <lkp@intel.com>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] crypto: x86/aria - Take the address of each asm function in one file
Date: Fri, 6 Nov 2026 19:25:17 +0800 [thread overview]
Message-ID: <au25HZSyqJMjW-F2@gondor.apana.org.au> (raw)
In-Reply-To: <20261012031920.i.329-kees@kernel.org>
On Sun, Oct 11, 2026 at 08:19:21PM -0700, Kees Cook wrote:
> A Clang Full LTO bug[1] was fixed in Clang 23 where multiple .o files
> performing an address-take of the same asm-originating typeid weak symbols
> would have those symbols get completely removed instead of just keeping
> one, seen at link time:
>
> ld.lld: error: undefined symbol: __kcfi_typeid_aria_aesni_avx_encrypt_16way
> >>> referenced by aria-aesni-avx-asm_64.S:962
> >>> vmlinux.o:(__cfi_aria_aesni_avx_encrypt_16way)
>
> As a work-around for earlier Clang, add aria_avx_setup_16way_ops() and
> aria_avx2_setup_32way_ops(), exported by the glue that owns each tier's
> asm functions, and fill all three tables with them, so that each asm
> function has its address taken in only one file.
>
> Build tested ARCH=x86_64 with the kernel test robot's randconfig
> (CONFIG_LTO_CLANG_FULL=y, CONFIG_CFI=y, and all three ARIA drivers built
> in) and W=1, with Clang 22.1.8 and Clang 24.0.0git: vmlinux.o defines all
> fifteen __kcfi_typeid_aria_* symbols, and vmlinux links. Without this
> change, Clang 22.1.8 fails to link it as above, and Clang 24.0.0git,
> which has the LLVM fix, links it.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202606041643.GyTZgCk1-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202606122021.pA9TozrA-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202608100432.yIX7TckM-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202610112311.o9XQsWsa-lkp@intel.com/
> Link: https://github.com/llvm/llvm-project/pull/204025 [1]
> Assisted-by: LLM
> Signed-off-by: Kees Cook <kees@kernel.org>
> ---
> arch/x86/crypto/aria-avx.h | 3 +++
> arch/x86/crypto/aria_aesni_avx2_glue.c | 35 ++++++++++++++-----------
> arch/x86/crypto/aria_aesni_avx_glue.c | 29 +++++++++++++-------
> arch/x86/crypto/aria_gfni_avx512_glue.c | 8 ++----
> 4 files changed, 45 insertions(+), 30 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2026-11-06 11:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 3:19 Kees Cook
2026-11-06 11:25 ` Herbert Xu [this message]
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=au25HZSyqJMjW-F2@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=ap420073@gmail.com \
--cc=kees@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=samitolvanen@google.com \
/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®