From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A2B4353A69 for ; Wed, 12 Aug 2026 16:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786551677; cv=none; b=MZkRa4gQnJRZaB0dTC6Sbft6kp4taXND+i044SrAirkmjIi8Lg2nCQfajbbSi2hOvmb/g4M92BBRVv4Hmij8Fle6x7+EesxOD/JuxmAu6mabZggRwf92x9hxlHxudAzaDMl7g+u6k1gaR39QQCYopsKvQZH0gCb8cObkClu/zb4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786551677; c=relaxed/simple; bh=t1mzG9sAxuYhYVzxySeHVpE1gwIi7wWs3ZJEMLRKnAk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ijSN7/nbviKZdimoJxukiIBDTeNB94rWLPQm+VlxqJUHtSxMJYgRCkB1SqYlPqCyzQqyEsnkIpGqTrxc0+zTjN6j89vrL0NcMI5GVCKB1s0VwI6jRSveILmXIXmbhf7prWHpnbD+sbUB/xt1koP8fbfhtb1wpPD3xFOZq7uYsl0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kWgCedTO; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kWgCedTO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 851941F000E9; Wed, 12 Aug 2026 16:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786551676; bh=eiuXefLgCGCI1r7YxmombeP0mg4dcvR6K6zniDNoOUY=; h=From:To:Cc:Subject:Date; b=kWgCedTON06n4m1F+9EDLTIF6+8EGVvsqW22h0hnpGBc2lHCrwHV0tFXN6qs/QeeF eAjGhMYy2vWEw0crE6W+WmbtrZpdwwMNerLTHqDaxBH+M/7MEIietD2B/UkMrh368O UYcMs6c/T84clbWRotucyfK86k1uWplMXAWOP0aICppRmK5hxis7NzrwcYkRRixN4e JfXDArSFlRaWOD0jSeEnuvwkBh5w4UEDiv+8HGKYqrXvsSntNcVOY3SeluHBlkG5P4 IhLfc8/oXBXo2P9Y6AwrGPG4hkxYmtuDC6VoTRbygVUPh/hMw2qeB8/cGN1dH9jkuE ChTpqtdPsMBCQ== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, Ard Biesheuvel , Mark Brown , Josh Poimboeuf , Nick Desaulniers Subject: [PATCH 0/2] arm64: Implement support for BTI veneers Date: Wed, 12 Aug 2026 18:20:59 +0200 Message-ID: <20260812162058.612202-4-ardb@kernel.org> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1379; i=ardb@kernel.org; h=from:subject; bh=t1mzG9sAxuYhYVzxySeHVpE1gwIi7wWs3ZJEMLRKnAk=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIatmbnZQE+/y7Xu1Xkf8nvZhQcmVubFuftdU7+x+enjL9 Crx1+czOkpZGMS4GGTFFFkEZv99t/P0RKla51myMHNYmUCGMHBxCsBERCcx/I/Q3XTfgHnnXT6n D1phfzcGiez++bXVpJ5xSnpQrF9k+B9GhgvnvN6pyEe+8P4Z1a0cP2vWgvdfpr12qCgN2/+bIXB +PDcA X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit Recent toolchains will omit BTI landing pads from functions with static linkage that never have their address taken. If a landing pad is needed nonetheless, it is up to the static linker to emit a BTI veneer withing direct branching range of the target, and direct the call to the veneer instead. Modules are partially linked objects, and so there is no static linker that can do this for us. Instead, the module loader must see to this. So implement this for the arm64 module loader. Patch #2 contains a test module that was used to validate the approach. Cc: Mark Brown Cc: Josh Poimboeuf Cc: Nick Desaulniers Link: https://lore.kernel.org/all/ed4fe1f95071897859ec7fbe9176246cbd4962bf.1786138806.git.jpoimboe@kernel.org/ Ard Biesheuvel (2): arm64: module: Emit BTI veneers for cross-section calls DONOTMERGE: arm64: module: Test module for BTI veneers arch/arm64/Kconfig | 2 - arch/arm64/include/asm/module.h | 12 ++ arch/arm64/include/asm/module.lds.h | 3 + arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/bti_veneer_test.c | 26 ++++ arch/arm64/kernel/module-plts.c | 128 +++++++++++++++++++- 6 files changed, 165 insertions(+), 7 deletions(-) create mode 100644 arch/arm64/kernel/bti_veneer_test.c -- 2.47.3