[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fp5amaygv37wxr6bglagljr325rsagllbabb62ow44kl3mznb6@gzk6nuukjgwv>
Date: Mon, 2 Jun 2025 22:43:33 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Peter Zijlstra <peterz@...radead.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 Thu, May 29, 2025 at 11:30:17AM +0200, Peter Zijlstra wrote:
> > > So the sequence of fail is:
> > >
> > > push %rbp
> > > mov %rsp, %rbp # cfa.base = BP
> > >
> > > SAVE
>
> sub $0x40,%rsp
> and $0xffffffffffffffc0,%rsp
>
> This hits the 'older GCC, drap with frame pointer' case in OP_SRC_AND.
> Which means we then hard rely on the frame pointer to get things right.
>
> However, per all the PUSH/POP_REGS nonsense, BP can get clobbered.
> Specifically the code between the CALL and POP %rbp below are up in the
> air. I don't think it can currently unwind properly there.
RBP is callee saved, so there's no need to pop it or any of the other
callee-saved regs. If they were to change, that would break C ABI
pretty badly. Maybe add a skip_callee=1 arg to POP_REGS?
--
Josh
Powered by blists - more mailing lists