All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dylan Hatch" <dylanbhatch@google.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>
Cc: "Herbert Xu" <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"Weinan Liu" <wnliu@google.com>,
	"Jens Remus" <jremus@linux.ibm.com>,
	linux-kbuild@vger.kernel.org, linux-crypto@vger.kernel.org,
	"Josh Poimboeuf" <jpoimboe@kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Indu Bhagat" <ibhagatgnu@gmail.com>,
	"Prasanna Kumar T S M" <ptsm@linux.microsoft.com>,
	live-patching@vger.kernel.org
Subject: Re: [RFC PATCH 01/12] arm64, unwind: build with .eh_frame and add gen_lr_unwind skeleton
Date: Wed, 18 Nov 2026 04:36:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-220104@kernel.org> (raw)
In-Reply-To: <20261117043504.1021063-2-dylanbhatch@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] scripts/gen_lr_unwind: unswapped little-endian ELF reads in
  main()
--

commit 4321126beda1768f44ea752930b88bd2f0c6cb2c
Author: Dylan Hatch <dylanbhatch@google.com>

arm64, unwind: build with .eh_frame and add gen_lr_unwind skeleton

This commit adds CONFIG_ARM64_LR_UNWIND to build the kernel with
.eh_frame unwind tables while discarding them in the final linker
scripts, and wires up a skeleton scripts/gen_lr_unwind host tool invoked
on vmlinux.o.

> diff --git a/scripts/gen_lr_unwind.c b/scripts/gen_lr_unwind.c
> new file mode 100644
> index 0000000000000..1b52662838653
> --- /dev/null
> +++ b/scripts/gen_lr_unwind.c
[ ... ]
> +	ehdr = ctx.map;
> +	if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) ||
> +	    ehdr->e_ident[EI_CLASS] != ELFCLASS64 ||
> +	    ehdr->e_ident[EI_DATA] != ELFDATA2LSB ||
> +	    ehdr->e_type != ET_REL ||
> +	    ehdr->e_machine != EM_AARCH64) {
> +		fprintf(stderr, "gen_lr_unwind: %s is not an AArch64 ET_REL ELF\n",
> +			argv[1]);
> +		goto out;
> +	}
> +
> +	shdrs = ctx.map + ehdr->e_shoff;
> +	shnum = ehdr->e_shnum == SHN_UNDEF ? shdrs[0].sh_size : ehdr->e_shnum;
> +	shstrndx = ehdr->e_shstrndx == SHN_XINDEX ?
> +		   shdrs[0].sh_link : ehdr->e_shstrndx;
> +	shstrtab = ctx.map + shdrs[shstrndx].sh_offset;
> +
> +	for (unsigned int i = 0; i < shnum; i++) {
> +		const char *name = shstrtab + shdrs[i].sh_name;

[Severity: Low]
Do these Elf64_Ehdr and Elf64_Shdr field reads need little-endian-to-host
conversion?  Cross-compiling an arm64 kernel on a big-endian host will
reject vmlinux.o at the e_type / e_machine check and misinterpret the
section header offsets.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117043504.1021063-1-dylanbhatch@google.com?part=1

  reply	other threads:[~2026-11-18  4:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  4:34 [RFC PATCH 00/12] arm64, unwind: add .lr_unwind unwinder for reliable stacktrace Dylan Hatch
2026-11-17  4:34 ` [RFC PATCH 01/12] arm64, unwind: build with .eh_frame and add gen_lr_unwind skeleton Dylan Hatch
2026-11-18  4:36   ` sashiko-bot [this message]
2026-11-17  4:34 ` [RFC PATCH 02/12] arm64: factor .eh_frame parser out of patch-scs.c into <asm/eh_frame.h> Dylan Hatch
2026-11-18  4:36   ` sashiko-bot
2026-11-17  4:34 ` [RFC PATCH 03/12] arm64: eh_frame: track CFA and x29/x30 register state in CFI parser Dylan Hatch
2026-11-17  4:34 ` [RFC PATCH 04/12] arm64, unwind: parse .eh_frame into .lr_unwind entries in gen_lr_unwind Dylan Hatch
2026-11-17  4:34 ` [RFC PATCH 05/12] scripts/gen_lr_unwind: emit .lr_unwind_fde and .lr_unwind_ranges Dylan Hatch
2026-11-17  4:34 ` [RFC PATCH 06/12] scripts/gen_lr_unwind: add --dump option to inspect .lr_unwind tables Dylan Hatch
2026-11-18  4:36   ` sashiko-bot
2026-11-17  4:34 ` [RFC PATCH 07/12] scripts/sorttable: sort .lr_unwind_fde by start_offset Dylan Hatch
2026-11-17  4:35 ` [RFC PATCH 08/12] arm64, unwind: add in-kernel .lr_unwind lookup and validation Dylan Hatch
2026-11-17  4:35 ` [RFC PATCH 09/12] arm64/module, unwind: add .lr_unwind support for modules Dylan Hatch
2026-11-17  4:35 ` [RFC PATCH 10/12] arm64: entry: add unwind info for call_on_irq_stack() Dylan Hatch
2026-11-17  4:35 ` [RFC PATCH 11/12] arm64, crypto/lib: annotate leaf functions with CFI info Dylan Hatch
2026-11-17  4:35 ` [RFC PATCH 12/12] unwind: arm64: use .lr_unwind to unwind interrupt frames Dylan Hatch
2026-11-18  4:36   ` 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=sashiko-outbox-220104@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ardb@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=jpoimboe@kernel.org \
    --cc=jremus@linux.ibm.com \
    --cc=justinstitt@google.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nsc@kernel.org \
    --cc=ptsm@linux.microsoft.com \
    --cc=rostedt@goodmis.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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 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.