mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] objtool: Fix SLS checks
Date: Mon, 2 May 2022 13:09:46 -0700	[thread overview]
Message-ID: <20220502200946.ji7jqoitz65sz7yx@treble> (raw)
In-Reply-To: <YnA4sS0hA6VwFKPd@hirez.programming.kicks-ass.net>

On Mon, May 02, 2022 at 10:01:53PM +0200, Peter Zijlstra wrote:
> On Mon, May 02, 2022 at 11:15:47AM -0700, Josh Poimboeuf wrote:
> > On Sat, Apr 30, 2022 at 12:50:02PM +0200, Peter Zijlstra wrote:
> > > 
> > > Fix the SLS validation; not having a next instruction is also a fail
> > > when the next instruction should be INSN_TRAP.
> > > 
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > ---
> > >  tools/objtool/check.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> > > index 3f6785415894..3354101ffe34 100644
> > > --- a/tools/objtool/check.c
> > > +++ b/tools/objtool/check.c
> > > @@ -3380,7 +3380,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
> > >  
> > >  		case INSN_RETURN:
> > >  			if (sls && !insn->retpoline_safe &&
> > > -			    next_insn && next_insn->type != INSN_TRAP) {
> > > +			    (!next_insn || (next_insn && next_insn->type != INSN_TRAP))) {
> > >  				WARN_FUNC("missing int3 after ret",
> > >  					  insn->sec, insn->offset);
> > >  			}
> > > @@ -3428,7 +3428,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
> > >  
> > >  		case INSN_JUMP_DYNAMIC:
> > >  			if (sls && !insn->retpoline_safe &&
> > > -			    next_insn && next_insn->type != INSN_TRAP) {
> > > +			    (!next_insn || (next_insn && next_insn->type != INSN_TRAP))) {
> > >  				WARN_FUNC("missing int3 after indirect jump",
> > >  					  insn->sec, insn->offset);
> > >  			}
> > 
> > My SLS rewrite in tip/objtool/core already fixed this, FWIW.  But this
> > could be good for -urgent.
> 
> Urgh, I should've looked at that indeed. This didn't find any new sites
> though; so I don't think this needs to go through urgent.

Well to be fair, it was easy to miss since I snuck it in with rewrite.

-- 
Josh


  reply	other threads:[~2022-05-02 20:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30 10:50 Peter Zijlstra
2022-05-02 18:15 ` Josh Poimboeuf
2022-05-02 20:01   ` Peter Zijlstra
2022-05-02 20:09     ` Josh Poimboeuf [this message]
2022-05-02 20:17   ` Peter Zijlstra
2022-05-03 21:15     ` Josh Poimboeuf
2022-05-04  7:26       ` Peter Zijlstra
2022-05-05 21:03         ` Josh Poimboeuf

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=20220502200946.ji7jqoitz65sz7yx@treble \
    --to=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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®