From: Catalin Marinas <catalin.marinas@arm.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Ard Biesheuvel <ardb+git@google.com>,
kernel-team@android.com, linux-hardening@vger.kernel.org,
Mark Rutland <mark.rutland@arm.com>,
Carlos Llamas <cmllamas@google.com>,
Sami Tolvanen <samitolvanen@google.com>,
Sean Christopherson <seanjc@google.com>,
Kees Cook <kees@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Will McVicker <willmcvicker@google.com>
Subject: Re: [PATCH v8] arm64: Use static call trampolines when kCFI is enabled
Date: Wed, 1 Apr 2026 15:31:59 +0100 [thread overview]
Message-ID: <ac0sX46TwAQAChWG@arm.com> (raw)
In-Reply-To: <2b0b9c69-650c-46bb-8579-4af85c17b8ab@app.fastmail.com>
On Wed, Apr 01, 2026 at 02:03:22PM +0200, Ard Biesheuvel wrote:
>
> On Wed, 1 Apr 2026, at 12:03, Will Deacon wrote:
> > On Tue, 31 Mar 2026 13:04:23 +0200, Ard Biesheuvel wrote:
> >> Implement arm64 support for the 'unoptimized' static call variety, which
> >> routes all calls through a trampoline that performs a tail call to the
> >> chosen function, and wire it up for use when kCFI is enabled. This works
> >> around an issue with kCFI and generic static calls, where the prototypes
> >> of default handlers such as __static_call_nop() and __static_call_ret0()
> >> don't match the expected prototype of the call site, resulting in kCFI
> >> false positives [0].
> >>
> >> [...]
> >
> > Applied to arm64 (for-next/fixes), thanks!
> >
> > [1/1] arm64: Use static call trampolines when kCFI is enabled
> > https://git.kernel.org/arm64/c/e70c2335f889
> >
>
> Thanks,
>
> I just spotted that the function name gets stringified twice inadvertently.
>
> E.g., the assembler may see
>
> .quad "__static_call_return0"
>
> rather than the intended
>
> .quad __static_call_return0
>
> The assembler does not seem to care, and still emits an ABS64 relocation against the correct symbol, but it is definitely unintentional.
>
> I can send a follow-up fix if you prefer, or you could just tweak the patch in place:
>
> --- a/arch/arm64/include/asm/static_call.h
> +++ b/arch/arm64/include/asm/static_call.h
> @@ -16,7 +16,7 @@
> " .popsection \n" \
> " .pushsection .rodata, \"a\" \n" \
> " .align 3 \n" \
> - "1: .quad " #target " \n" \
> + "1: .quad " target " \n" \
> " .popsection \n")
Not sure Will is going to look at this until next week. I folded it into
the arm64 for-next/fixes branch and pushed out.
--
Catalin
prev parent reply other threads:[~2026-04-01 14:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 11:04 [PATCH v8] arm64: Use static call trampolines when kCFI is enabled Ard Biesheuvel
2026-03-31 12:06 ` Ard Biesheuvel
2026-04-01 10:03 ` Will Deacon
2026-04-01 12:03 ` Ard Biesheuvel
2026-04-01 14:31 ` Catalin Marinas [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=ac0sX46TwAQAChWG@arm.com \
--to=catalin.marinas@arm.com \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=cmllamas@google.com \
--cc=kees@kernel.org \
--cc=kernel-team@android.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hardening@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=peterz@infradead.org \
--cc=samitolvanen@google.com \
--cc=seanjc@google.com \
--cc=will@kernel.org \
--cc=willmcvicker@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.