Re: [PATCH v4 15/22] objtool: Prevent kCFI hashes from being decoded as instructions
Song Liu <[email protected]>
| Newsgroups | org.kernel.vger.live-patching,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAPhsuW7Vdni1Bj7b9R_yR6TKvOYSbKDjz0qdWkfN6jO1JAYNSw@mail.gmail.com> |
On Tue, Aug 11, 2026 at 5:30 PM Josh Poimboeuf <[email protected]> wrote: > > On Tue, Aug 11, 2026 at 04:58:05PM -0700, Song Liu wrote: > > On Sat, Aug 8, 2026 at 4:18 PM Josh Poimboeuf <[email protected]> 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. I see. Then this should be fine. Thanks! Acked-by: Song Liu <[email protected]>