mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Song Liu <song@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	 live-patching@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	 Joe Lawrence <joe.lawrence@redhat.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	 Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	 Mark Rutland <mark.rutland@arm.com>,
	Nathan Chancellor <nathan@kernel.org>,
	 Nicolas Schier <nsc@kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	 Miroslav Benes <mbenes@suse.cz>, Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH v4 15/22] objtool: Prevent kCFI hashes from being decoded as instructions
Date: Tue, 11 Aug 2026 17:30:34 -0700	[thread overview]
Message-ID: <anu-Xbm02J7BgCIb@jpoimboe> (raw)
In-Reply-To: <CAPhsuW5tzBOHnw42d31r_5k9eS28VrDLGXoUzS=hYkZmAyRbhw@mail.gmail.com>

On Tue, Aug 11, 2026 at 04:58:05PM -0700, Song Liu wrote:
> On Sat, Aug 8, 2026 at 4:18 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
> [...]
> >
> > +/*
> > + * ARM64 mapping symbols ($d, $x, $a, __pi_$d, etc) which mark transitions
> > + * between code and data.
> > + */
> > +static inline bool is_mapping_sym(struct symbol *sym)
> > +{
> > +       return is_notype_sym(sym) && strchr(sym->name, '$');
> > +}
> > +
> > +static inline bool is_data_mapping_sym(struct symbol *sym)
> > +{
> > +       const char *dollar;
> > +
> > +       if (!is_mapping_sym(sym))
> > +               return false;
> > +
> > +       dollar = strchr(sym->name, '$');
> > +       return dollar && dollar[1] == 'd';
> 
> nit: is_data_mapping_sym() calls strchr() twice. Maybe we can
> optimize it by eliminating a strchr()?

I suppose it's a bit funky, but the compiler CSEs it, so it's harmless.

-- 
Josh

  reply	other threads:[~2026-08-12  0:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-08 23:17 [PATCH v4 00/22] objtool/arm64: Port klp-build to arm64 Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 01/22] objtool/klp: Fix .kcfi_traps special section extraction Josh Poimboeuf
2026-08-11 23:27   ` Song Liu
2026-08-13 11:16   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 02/22] klp-build: Reject patches to init/*.c Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 03/22] arm64: Annotate intra-function calls Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 04/22] arm64: Fix EFI linking with -fdata-sections Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 05/22] arm64: Rename TRAMP_VALIAS -> TRAMP_VALIAS_ASM in asm-offsets Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 06/22] arm64: vdso: Discard .discard.* sections Josh Poimboeuf
2026-08-11 23:30   ` Song Liu
2026-08-08 23:17 ` [PATCH v4 07/22] arm64: Annotate special section entries Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 08/22] arm64: Remove unnecessary empty alternatives Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 09/22] crypto: arm64: Move data to .rodata Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 10/22] objtool: Allow setting --mnop without --mcount Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 11/22] kbuild: Only run objtool if there is at least one command Josh Poimboeuf
2026-08-11 23:40   ` Song Liu
2026-08-08 23:17 ` [PATCH v4 12/22] objtool: Ignore jumps to the end of the function for checksum runs Josh Poimboeuf
2026-08-11 23:41   ` Song Liu
2026-08-08 23:17 ` [PATCH v4 13/22] objtool: Refactor elf_add_data() to use a growable data buffer Josh Poimboeuf
2026-08-11 23:48   ` Song Liu
2026-08-08 23:17 ` [PATCH v4 14/22] objtool: Reuse string references Josh Poimboeuf
2026-08-11 23:52   ` Song Liu
2026-08-12  0:23     ` Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 15/22] objtool: Prevent kCFI hashes from being decoded as instructions Josh Poimboeuf
2026-08-11 23:58   ` Song Liu
2026-08-12  0:30     ` Josh Poimboeuf [this message]
2026-08-12  4:37       ` Song Liu
2026-08-08 23:17 ` [PATCH v4 16/22] objtool/klp: Add arm64 support for prefix/PFE detection Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 17/22] objtool/klp: Filter arm64 mapping symbols in find_symbol_by_offset() Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 18/22] objtool/klp: Don't correlate arm64 mapping symbols Josh Poimboeuf
2026-08-12  0:00   ` Song Liu
2026-08-08 23:17 ` [PATCH v4 19/22] objtool/klp: Clone inline alternative replacements Josh Poimboeuf
2026-08-08 23:17 ` [PATCH v4 20/22] objtool/klp: Introduce objtool for arm64 Josh Poimboeuf
2026-08-12  0:01   ` Song Liu
2026-08-08 23:17 ` [PATCH v4 21/22] klp-build: Support cross-compilation Josh Poimboeuf
2026-08-12  0:02   ` Song Liu
2026-08-08 23:17 ` [PATCH v4 22/22] klp-build: Add arm64 syscall patching macro Josh Poimboeuf
2026-08-12  0:02   ` Song Liu

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=anu-Xbm02J7BgCIb@jpoimboe \
    --to=jpoimboe@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=joe.lawrence@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mbenes@suse.cz \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=song@kernel.org \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /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®