[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250528163557.GI31726@noisy.programming.kicks-ass.net>
Date: Wed, 28 May 2025 18:35:57 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Sean Christopherson <seanjc@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org, kys@...rosoft.com,
haiyangz@...rosoft.com, wei.liu@...nel.org, decui@...rosoft.com,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, pbonzini@...hat.com, ardb@...nel.org,
kees@...nel.org, Arnd Bergmann <arnd@...db.de>,
gregkh@...uxfoundation.org, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-efi@...r.kernel.org, samitolvanen@...gle.com,
ojeda@...nel.org, xin@...or.com
Subject: Re: [PATCH v2 00/13] objtool: Detect and warn about indirect calls
in __nocfi functions
On Wed, May 28, 2025 at 06:30:35PM +0200, Peter Zijlstra wrote:
> On Wed, May 28, 2025 at 09:44:52AM +0200, Peter Zijlstra wrote:
> > On Tue, May 06, 2025 at 12:18:49PM -0700, Josh Poimboeuf wrote:
> >
> > > Weird, I'm not seeing that.
> >
> > I Ate'nt Crazeh...
> >
> > https://lore.kernel.org/all/202505280410.2qfTQCRt-lkp@intel.com/T/#u
> >
> > I'll go poke at it, see if today is the day I can figure out WTF
> > happens.
>
> It manages to trip the CFI_UNDEFINED case in op->dest.reg == cfa->base
> in update_cfi_state().
>
> I figured it ought to tickle the regular 'mov %rbp, %rsp' case above
> there, but it doesn't, for some reason it has cfa.base == SP at this
> point.
>
> This happens... /me looks in scrollback ... at POP_REGS 'pop
> %rbp'. ARGH!!
>
>
> So the sequence of fail is:
>
> push %rbp
> mov %rsp, %rbp # cfa.base = BP
>
> SAVE
> ...
> push %rbp
> ...
> pop %rbp # cfa.base = SP
This is the POP !drap and dest==base case.
> ...
> mov %rbp, %rsp # UNDEF
> nop # FAIL
> RESTORE
>
> Note that the MOV+NOP is the 4 bytes ERETS needs.
Powered by blists - more mailing lists