Live Patching
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Catalin Marinas" <catalin.marinas@arm.com>,
	"Josh Poimboeuf" <jpoimboe@kernel.org>,
	"Will Deacon" <will@kernel.org>
Cc: "Mark Brown" <broonie@kernel.org>,
	"Joe Lawrence" <joe.lawrence@redhat.com>,
	"Song Liu" <song@kernel.org>, "Ard Biesheuvel" <ardb@kernel.org>,
	"Petr Mladek" <pmladek@suse.com>,
	linux-kernel@vger.kernel.org,
	"Mark Rutland" <mark.rutland@arm.com>,
	linux-toolchains@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	live-patching@vger.kernel.org, "Miroslav Benes" <mbenes@suse.cz>,
	"Kees Cook" <kees@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>
Subject: Re: [PATCH 11/12] arm64/bti: Force-enable BTI linker veneers
Date: Sat, 15 Aug 2026 05:00:58 +0000	[thread overview]
Message-ID: <20260815050058.ACCE51F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <edae8b52c1cba6eecd0bc75f709f6009816b80b8.1786768375.git.jpoimboe@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ld-option incorrectly evaluates to true for -z force-bti on older GNU ld versions, causing build failures.
--

--- Patch [11]: [PATCH 11/12] arm64/bti: Force-enable BTI linker veneers ---
commit dc92fd3fe21010a76154b8b30a8e4ff7c0d55416
Author: Josh Poimboeuf <jpoimboe@kernel.org>

arm64/bti: Force-enable BTI linker veneers

This commit force-enables BTI veneers using the "-z force-bti" linker
option to ensure they are created even if some input objects are missing
the BTI feature bit. This aims to prevent silent runtime BTI exceptions
on larger kernels.

> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 4eee721c0b278..d0db9a6766a2f 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -25,6 +25,7 @@ endif
>  
>  ifeq ($(CONFIG_ARM64_BTI_KERNEL),y)
>  KBUILD_AFLAGS	+= -include $(srctree)/arch/arm64/include/asm/bti-note.h
> +LDFLAGS_vmlinux	+= $(call ld-option,-z force-bti)

[Severity: Medium]
Does this ld-option check reliably detect if the linker supports "-z force-bti"?

When Kbuild's ld-option tests linker support, it executes the linker with "-v".
However, when GNU ld is invoked with "-v" and no input files, it prints its
version information and immediately exits with a 0 status code, completely
bypassing any validation of keyword arguments like "-z".

Because of this, ld-option will falsely report that "-z force-bti" is supported
on all versions of GNU ld, even older versions (prior to 2.34) where the option
was not yet introduced. 

During the actual kernel link, ld parses the "-z" list, fails to recognize
"force-bti", and emits an ignored warning. If CONFIG_WERROR=y is set, the linker
escalates this warning to a fatal error and breaks the build. On builds without
CONFIG_WERROR, the warning is ignored and the patch silently fails to enforce
the intended BTI veneers.

>  endif
>  
>  cc_has_k_constraint := $(call try-run,echo				\

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1786768375.git.jpoimboe@kernel.org?part=11

  reply	other threads:[~2026-08-15  5:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-15  4:45 [PATCH 00/12] arm64/bti: Fix kernel BTI issues with livepatch, large kernels, toolchains Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 01/12] arm64/bti: Add BTI landing pad to __sdei_asm_handler() Josh Poimboeuf
2026-08-15  5:01   ` sashiko-bot
2026-08-15  4:45 ` [PATCH 02/12] arm64/module: Fix BTI exceptions caused by omitted landing pads in Clang 21 Josh Poimboeuf
2026-08-15  5:00   ` sashiko-bot
2026-08-15  9:56   ` Ard Biesheuvel
2026-08-15  4:45 ` [PATCH 03/12] arm64/bti: Fix BTI linker failures with long branches into .idmap.text Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 04/12] arm64/bti: Work around ld crash caused by linker script aliases Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 05/12] arm64/bti: Add link error for large kernels with BTI and unsupported toolchains Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 06/12] arm64/bti: Add link error for large kernels with BTI and livepatch Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 07/12] arm64/bti: Advertise BTI in assembly objects Josh Poimboeuf
2026-08-15  5:03   ` sashiko-bot
2026-08-15  4:45 ` [PATCH 08/12] arm64/bti: Enable BTI in the pi/ startup code Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 09/12] efi/libstub: Preserve the GNU property note Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 10/12] efi/libstub: Remove obsolete .note.gnu.property workaround Josh Poimboeuf
2026-08-15  4:45 ` [PATCH 11/12] arm64/bti: Force-enable BTI linker veneers Josh Poimboeuf
2026-08-15  5:00   ` sashiko-bot [this message]
2026-08-15  4:45 ` [PATCH 12/12] arm64/bti: Enable kernel BTI for GCC Josh Poimboeuf

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=20260815050058.ACCE51F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ardb@kernel.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mbenes@suse.cz \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=pmladek@suse.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=song@kernel.org \
    --cc=will@kernel.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