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 467CA42847B for ; Tue, 11 Aug 2026 16:55:17 +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=1786467318; cv=none; b=soTEjXd8dC54wpwWzyEkZ8CTn4MOT7sEwGgabroFv0JKLIgEDNVfTBsPr622k2YHGPSoVoZD1hNoE4yhepMDX5CT1GFc4c078aoOz3cMaYoLGzb4YjvYuxDOxX3xTA3fKfuaRXDLmiwJ3L5szkluzuJA8pfaWy5grFcATcck0cY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786467318; c=relaxed/simple; bh=fK158/seF8uqB+NNXTyC3UH8OqZuGnbBo0tzvbIug1k=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=R+cw02DhuEh9AAdI08yK1KVhZLc6ssyiCYsvxSiJhPTzF9Xu27xRESCnMY/k9zF34ngwGbxgamTi+ljkco/GVu0BTOsbB7+S+Legk4ii6upVCG6gQsFJbBBgrj80R81v/LmTEXT4zfHEtRWDVwvjPR2DuqM+NOnpfjMw7tM7pzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SiPVmjPU; 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="SiPVmjPU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCEF81F00A3D; Tue, 11 Aug 2026 16:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786467317; bh=K74qCRzxn651l3XaxagRai5qzbIH3fM2gu1tb8jTrx0=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=SiPVmjPUCYCxgQzflAyEvjyLjnx5GvlEuODxiPI8m++VKdO0I8M3VOV547DreCsnZ J2q6XfOxN4h2D1YzLk1s3DwmE9luW5dN/B66tPRp4zNDTYKTijlqAMt/eZaxZzx+Ml 2tfsASB8FGYkK9fybZKshiZ3hmDfVP60wUpnFlK1I5BtYfUoPqN7A14w0gqA7hB74j cSP7j5K05C8x4voipdJFHuWOZ1Oonj8Xvjs2Mnv3hKDE+tuAQHGcQ7vzBVrZ6FTItY TmumGHNCdLYGd7DesLI0+JRgDuGdrOmHgp40l6MMFJ6EwU34RQQR8561e3S0STfSvm MMz+KfVUfRsaQ== Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfauth.ams.internal (Postfix) with ESMTP id 67BA11980054; Tue, 11 Aug 2026 12:55:14 -0400 (EDT) Received: from ams-imap-11 ([10.64.2.31]) by ams-compute-02.internal (MEProxy); Tue, 11 Aug 2026 12:55:14 -0400 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTFLc7TJ0dCZCnX8dz/KaeoCy81UUCnt5usIFl0AbbXPkucwxamVid5h2jlpBQ/6LL tkmHNiBDJbnaueeGmoN5qhchkdBHK0JaoAv9ua78VI5NXvIlN4AZTsW9oIkre85QvVOX8O KG9TOwxxELKxGxQVI5OHhEkppJjUIqoQhBGdlmWrjaChLy54Fo00vYU4mB5CxgH4nLOUnr l/HKgI1B45m76zJ2Ilm7k34nZwAS/QrFjzIfD1LSfKbsV8Y+rgioXB3PgLFDWcwwf7TKUD a3rMaLk0nBXVC3IEguTnZiQbUt7dwuCcq8aQ2uaHyGkjuT5aH59w9EChvazhf7QBSPjDAZ btPY06AHFTIIm9P/l8h2EtOIV7gp18ZxiSvgrEzMl55Ixju9io10JfX1dlBhj7o9eP75fp imKHBSS0JKfkxL7SM/rPBjzjB3aCrZJOfxK8kPujWtJmLcFJRrLHkhqF3k00hlNWvDl+U8 qQnwknKwLkDTDNb4U+cOX8Z4mBFfbZcKHY8B4Hxv1QAFrN8HO10a/nv0WV+lirE0FP9WhV EJ1Snv5EEvBqNmZSQoZS0ON+ZCmU+UIWmy05UW+4gTRXyQRrFqt2ygjTU+cAmFShxQz07+ HxEl3mtTcAbaQtydmWg52Wezoed8gLO6FO7KGtd/o9CqQQjdbBDHfn+q538A X-ME-Proxy: Feedback-ID: ice86485a:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id A4453F8006E; Tue, 11 Aug 2026 12:55:11 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Tue, 11 Aug 2026 18:54:51 +0200 From: "Ard Biesheuvel" To: "Nick Desaulniers" , "Josh Poimboeuf" Cc: "Will Deacon" , "Catalin Marinas" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, "Song Liu" , "Miroslav Benes" , "Petr Mladek" , "Joe Lawrence" , "Mark Rutland" , "Mark Brown" , "Kees Cook" Message-Id: In-Reply-To: References: <08d6c5cd-9924-4359-9181-a03718161528@app.fastmail.com> <4986ac98-d6da-474a-b218-b6468b68cb9f@app.fastmail.com> <16e3ed42-1b1f-4ddc-9d8c-5e12ee7dbe3c@app.fastmail.com> Subject: Re: [PATCH] arm64/module: Fix livepatch BTI exceptions with Clang 21+ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, 11 Aug 2026, at 18:52, Nick Desaulniers wrote: > On Tue, Aug 11, 2026 at 9:41=E2=80=AFAM Josh Poimboeuf wrote: >> >> On Tue, Aug 11, 2026 at 09:27:28AM -0700, Nick Desaulniers wrote: >> > On Tue, Aug 11, 2026 at 7:23=E2=80=AFAM Will Deacon wrote: >> > > >> > > On Tue, Aug 11, 2026 at 03:18:17PM +0200, Ard Biesheuvel wrote: >> > > > >> > > > On Tue, 11 Aug 2026, at 14:02, Ard Biesheuvel wrote: >> > > > > On Tue, 11 Aug 2026, at 11:44, Will Deacon wrote: >> > > > >> On Mon, Aug 10, 2026 at 09:41:35AM -0700, Nick Desaulniers w= rote: >> > > > > >> > > > >>> Sure, but let's replace this with a link to a bug report in= llvm's >> > > > >>> issue tracker? >> > > > >> >> > > > >> Yes, please! I can apply the patch once we have the bug numb= er. >> > > > >> >> > > > > >> > > > > I can look into that. >> > > > >> > > > https://github.com/llvm/llvm-project/issues/215547 >> > > >> > > Thanks, Ard. I've ended up with the patch below. >> > >> > What's the extent that HAVE_LIVEPATCH will be used? >> > >> > Does this penalize kernels built with BTI in favor of HAVE_LIVEPATC= H? >> > >> > For example, with my Android hat on, if we have a kernel that's bui= lt >> > with ARM64_BTI_KERNEL=3Dy, and _dont_ use HAVE_LIVEPATCH, we're goi= ng to >> > turn off BTI for a feature we're not using? But maybe we _do_ inte= nd >> > to use HAVE_LIVEPATCH, and my assumption was wrong? >> >> The problem isn't specific to livepatch, livepatch just makes it easi= er >> to hit. > > Rereading Ard's report, let me see if I can articulate _how_ and tell > me if I'm still not getting it. > > Let's say we have code in .init.text that calls code in .text. If > .text was placed large enough away from .init.text, we get a veneer > inserted by _the kernel_ (not the linker). This veneer has an > indirect call to the destination. No landing pad. Boom. > > Is that precise? > Yes.