From: sashiko-bot@kernel.org
To: "Peter Zijlstra" <peterz@infradead.org>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Indu Bhagat" <ibhagatgnu@gmail.com>,
"Dylan Hatch" <dylanbhatch@google.com>,
"Jens Remus" <jremus@linux.ibm.com>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Jiri Kosina" <jikos@kernel.org>, "Weinan Liu" <wnliu@google.com>,
"Mark Rutland" <mark.rutland@arm.com>,
"Josh Poimboeuf" <jpoimboe@kernel.org>,
"Will Deacon" <will@kernel.org>
Cc: "Mostafa Saleh" <smostafa@google.com>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
linux-toolchains@vger.kernel.org, live-patching@vger.kernel.org,
joe.lawrence@redhat.com,
"Prasanna Kumar T S M" <ptsm@linux.microsoft.com>,
"Puranjay Mohan" <puranjay@kernel.org>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Randy Dunlap" <rdunlap@infradead.org>,
"Song Liu" <song@kernel.org>
Subject: Re: [PATCH v7 10/11] arm64, crypto/lib: Annotate leaf functions with CFI info
Date: Fri, 18 Sep 2026 22:58:16 +0000 [thread overview]
Message-ID: <20260918225817.5840A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260918224157.1471085-11-dylanbhatch@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] arm64: CFI start directive placed before function alignment corrupts DWARF FDE bounds
--
commit 498fccd9732a9f4edcb2b385432263d6681de459
Author: Dylan Hatch <dylanbhatch@google.com>
arm64, crypto/lib: Annotate leaf functions with CFI info
This commit adds simple CFI annotations to assembly leaf functions so that
the link register can be recovered by the unwinder. It introduces the
SYM_LEAF_FUNC_START macro family for these annotations.
> diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h
> index d1f7a16729d25..c4377e6ba0a67 100644
> --- a/arch/arm64/include/asm/linkage.h
> +++ b/arch/arm64/include/asm/linkage.h
> @@ -47,4 +53,27 @@
>
> #define __bss_pgtbl __section(".bss..pgtbl") __aligned(PAGE_SIZE)
>
> +/*
> + * SYM_[TYPED_]LEAF_FUNC_[START|END] macros add CFI minimal CFI directives
> + * allowing .sframe data to be generated for functions which do not modify the
> + * LR (x30). Unwind data will not be correct if these macros are used on
> + * non-leaf functions, as additional CFI directives would be necessary in such
> + * cases.
> + */
> +#define SYM_LEAF_FUNC_START(name) \
> + .cfi_startproc ; \
> + SYM_FUNC_START(name)
[Severity: Medium]
Will placing .cfi_startproc before SYM_FUNC_START() cause the DWARF FDE bounds
to include alignment padding bytes?
Since SYM_FUNC_START() emits the .balign directive for the function,
placing .cfi_startproc before it captures this padding. This can misalign
the FDE start address relative to the function symbol, which could confuse
stack unwinders like the sframe unwinder.
Should the .cfi_startproc directive be emitted after the alignment within
SYM_FUNC_START() completes?
> +
> +#define SYM_LEAF_FUNC_END(name) \
> + .cfi_endproc ; \
> + SYM_FUNC_END(name)
> +
> +#define SYM_LEAF_FUNC_START_LOCAL(name) \
> + .cfi_startproc ; \
> + SYM_FUNC_START_LOCAL(name)
[Severity: Medium]
Does the same alignment issue apply to SYM_LEAF_FUNC_START_LOCAL()? The
.cfi_startproc directive is emitted before SYM_FUNC_START_LOCAL(), which
also handles function alignment.
> +
> +#define SYM_TYPED_LEAF_FUNC_START(name) \
> + .cfi_startproc ; \
> + SYM_TYPED_FUNC_START(name)
[Severity: Medium]
Could this also lead to misaligned FDE start addresses for typed leaf
functions, since .cfi_startproc is placed before SYM_TYPED_FUNC_START()
alignment?
> +
> #endif
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260918224157.1471085-1-dylanbhatch@google.com?part=10
next prev parent reply other threads:[~2026-09-18 22:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 22:41 [PATCH v7 00/11] unwind, arm64: add sframe unwinder for kernel Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 01/11] arm64, unwind: build kernel with sframe V3 info Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 02/11] arm64/sframe: Read vmlinux .sframe header Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 03/11] sframe: Add support for reading vmlinux .sframe contents Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 04/11] sframe: Separate reading of FRE from reading of FRE data words Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 05/11] arm64/module, sframe: Add sframe support for modules Dylan Hatch
2026-09-18 22:54 ` sashiko-bot
2026-09-18 22:41 ` [PATCH v7 06/11] arm64/sframe: Validate IP addresses Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 07/11] sframe: Add debug helpers with object name Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 08/11] sframe: Add .sframe validation option Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 09/11] arm64: entry: add unwind info for call_on_irq_stack() Dylan Hatch
2026-09-18 22:41 ` [PATCH v7 10/11] arm64, crypto/lib: Annotate leaf functions with CFI info Dylan Hatch
2026-09-18 22:58 ` sashiko-bot [this message]
2026-09-18 22:41 ` [PATCH v7 11/11] unwind: arm64: Use sframe to unwind interrupt frames Dylan Hatch
2026-09-18 23:00 ` sashiko-bot
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=20260918225817.5840A1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=davem@davemloft.net \
--cc=dylanbhatch@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=ibhagatgnu@gmail.com \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=jremus@linux.ibm.com \
--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=peterz@infradead.org \
--cc=ptsm@linux.microsoft.com \
--cc=puranjay@kernel.org \
--cc=rdunlap@infradead.org \
--cc=roman.gushchin@linux.dev \
--cc=rostedt@goodmis.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=smostafa@google.com \
--cc=song@kernel.org \
--cc=will@kernel.org \
--cc=wnliu@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®