lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220318170312.rc2zgtubddg4dpya@treble>
Date:   Fri, 18 Mar 2022 10:03:12 -0700
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Lai Jiangshan <jiangshanlai@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
        Lai Jiangshan <jiangshan.ljs@...group.com>,
        Joerg Roedel <jroedel@...e.de>,
        Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] x86/sev: Add ENCODE_FRAME_POINTER after stack changed
 for #VC

On Fri, Mar 18, 2022 at 09:14:09AM +0800, Lai Jiangshan wrote:
> On Fri, Mar 18, 2022 at 6:19 AM Josh Poimboeuf <jpoimboe@...hat.com> wrote:
> >
> > On Wed, Mar 16, 2022 at 12:16:12PM +0800, Lai Jiangshan wrote:
> > > From: Lai Jiangshan <jiangshan.ljs@...group.com>
> > >
> > > In idtentry_vc(), the real frame is changed after it switches to new
> > > stack, ENCODE_FRAME_POINTER should be called in case for unwinder.
> > >
> > > Cc: Joerg Roedel <jroedel@...e.de>
> > > Cc: Josh Poimboeuf <jpoimboe@...hat.com>
> > > Signed-off-by: Lai Jiangshan <jiangshan.ljs@...group.com>
> > > ---
> > >  arch/x86/entry/entry_64.S | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
> > > index e20eabaa56b8..f99f2881ed83 100644
> > > --- a/arch/x86/entry/entry_64.S
> > > +++ b/arch/x86/entry/entry_64.S
> > > @@ -540,6 +540,7 @@ SYM_CODE_START(\asmsym)
> > >       call    vc_switch_off_ist
> > >       movq    %rax, %rsp              /* Switch to new stack */
> > >
> > > +     ENCODE_FRAME_POINTER
> > >       UNWIND_HINT_REGS
> > >
> > >       /* Update pt_regs */
> >
> > Looks right to me.  Any chance you have the ability to test this
> > scenario by unwinding from #VC with CONFIG_FRAME_POINTER?
> >
> 
> I don't have the hardware to test it.  Actually, it was you to
> inspire me to find this in the conversation of my patchset when
> I tried to search all the code of switching of %rsp to see how
> ENCODE_FRAME_POINTER and UNWIND_HINT_REGS are used once more.

Ok, maybe Joerg can test it.  It looks obviously right to me though.
Since it fixes a real frame pointer unwinding bug, it probably needs:

  Fixes: a13644f3a53d ("x86/entry/64: Add entry code for #VC handler")

Acked-by: Josh Poimboeuf <jpoimboe@...hat.com>

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ