From: Greg KH <gregkh@linuxfoundation.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>,
"Paul E. McKenney" <paulmck@kernel.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
x86@kernel.org, peterz@infradead.org, keescook@chromium.org,
elver@google.com, dvyukov@google.com, glider@google.com
Subject: Re: [BUG] missing return thunk: __ret+0x5/0x7e-__ret+0x0/0x7e: e9 f6 ff ff ff
Date: Sat, 26 Aug 2023 13:24:33 +0200 [thread overview]
Message-ID: <2023082618-pulse-wildcat-6746@gregkh> (raw)
In-Reply-To: <20230825232657.psb7c7x2tdgzciqw@treble>
On Fri, Aug 25, 2023 at 04:26:57PM -0700, Josh Poimboeuf wrote:
> On Thu, Aug 24, 2023 at 03:52:56PM +0200, Greg KH wrote:
> > On Wed, Aug 16, 2023 at 08:17:20PM +0200, Borislav Petkov wrote:
> > > Hey Paul,
> > >
> > > On Wed, Aug 16, 2023 at 10:54:09AM -0700, Paul E. McKenney wrote:
> > > > I hit the splat at the end of this message in recent mainline, and has
> > > > appeared some time since v6.5-rc1. Should I be worried?
> > >
> > > does it go away if you try the latest tip:x86/urgent branch?
> >
> > Note, this problem is showing up in the 6.1.y branch right now, due to
> > one objtool patch not being able to be backported there easily (i.e. I
> > tried and gave up.)
> >
> > 4ae68b26c3ab ("objtool/x86: Fix SRSO mess") being the commit that I
> > can't seem to get to work properly, my attempt can be seen here:
> > https://lore.kernel.org/r/2023082212-pregnant-lizard-80e0@gregkh
>
> > --- a/tools/objtool/arch/x86/decode.c
> > +++ b/tools/objtool/arch/x86/decode.c
> > @@ -796,8 +796,11 @@ bool arch_is_retpoline(struct symbol *sy
> >
> > bool arch_is_rethunk(struct symbol *sym)
> > {
> > - return !strcmp(sym->name, "__x86_return_thunk") ||
> > - !strcmp(sym->name, "srso_untrain_ret") ||
> > - !strcmp(sym->name, "srso_safe_ret") ||
> > - !strcmp(sym->name, "retbleed_return_thunk");
> > + return !strcmp(sym->name, "__x86_return_thunk");
> > +}
> > +
> > +bool arch_is_embedded_insn(struct symbol *sym)
> > +{
> > + return !strcmp(sym->name, "retbleed_return_thunk") ||
> > + !strcmp(sym->name, "srso_safe_ret");
>
> This wouldn't work with the current 6.1.y branch, I assume you had some
> other patches applied before this. e.g., the patch renaming __ret to
> retbleed_return_thunk.
Yes, I did.
> > }
> > --- a/tools/objtool/check.c
> > +++ b/tools/objtool/check.c
> > @@ -418,7 +418,7 @@ static int decode_instructions(struct ob
> > }
> >
> > list_for_each_entry(func, &sec->symbol_list, list) {
> > - if (func->type != STT_FUNC || func->alias != func)
> > + if (func->embedded_insn || func->alias != func)
> > continue;
>
> This hunk looks like a bug. This might be the source of your problems.
Ah, I guessed wrong on that change, my fault :(
> The below patch seems to work on stock 6.1.47. Or if you have other
> SRSO patches pending, point me to them and I can look at porting this
> one to fit.
I got this to apply on top of the latest series (-rc) and it passes
test-builds here. I'll do a release now without it and then queue this
up, along with some other fixes for reported problems in previous
releases, and release it so that the CI systems can go at it.
Many thanks for this!
greg k-h
next prev parent reply other threads:[~2023-08-26 11:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 17:54 [BUG] missing return thunk: __ret+0x5/0x7e-__ret+0x0/0x7e: e9 f6 ff ff ff Paul E. McKenney
2023-08-16 18:17 ` Borislav Petkov
2023-08-16 18:54 ` Paul E. McKenney
2023-08-24 13:52 ` Greg KH
2023-08-25 6:33 ` Borislav Petkov
2023-08-25 7:15 ` Josh Poimboeuf
2023-08-25 7:24 ` Greg KH
2023-08-25 23:26 ` Josh Poimboeuf
2023-08-26 11:24 ` Greg KH [this message]
2023-08-17 20:49 ` Nikolay Borisov
2023-08-17 21:29 ` Paul E. McKenney
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=2023082618-pulse-wildcat-6746@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=bp@alien8.de \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=jpoimboe@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@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