lkml.org 
[lkml]   [2022]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 34/39] objtool: Validate IBT assumptions
On Sun, Feb 27, 2022 at 02:20:55PM -0800, Josh Poimboeuf wrote:
> On Sun, Feb 27, 2022 at 06:00:03PM +0100, Peter Zijlstra wrote:
> > > > @@ -3101,6 +3164,17 @@ static int validate_branch(struct objtoo
> > > >
> > > > if (insn->hint) {
> > > > state.cfi = *insn->cfi;
> > > > + if (ibt) {
> > > > + struct symbol *sym;
> > > > +
> > > > + if (insn->cfi->type == UNWIND_HINT_TYPE_REGS_PARTIAL &&
> > > > + (sym = find_symbol_by_offset(insn->sec, insn->offset)) &&
> > > > + insn->type != INSN_ENDBR && !insn->noendbr) {
> > > > + WARN_FUNC("IRET_REGS hint without ENDBR: %s",
> > > > + insn->sec, insn->offset,
> > > > + sym->name);
> > > > + }
> > >
> > > No need to print sym->name here, WARN_FUNC() already does it?
> >
> > Almost; perhaps the change to make is to either introduce WARN_SYM or
> > make WARN_FUNC also print !STT_FUNC symbols ?
>
> In the case of no function, WARN_FUNC() falls back to printing sec+off.
> Is that not good enough?

I got really tired of doing the manual symbol lookup... I don't suppose
it matters too much now that I've more or less completed the triage, but
it was useful.

\
 
 \ /
  Last update: 2022-02-28 10:49    [W:0.180 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site