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] [day] [month] [year] [list]
Date:   Fri, 8 Jan 2021 11:32:52 -0800
From:   "Hyunwook (Wooky) Baek" <baekhw@...gle.com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Joerg Roedel <jroedel@...e.de>,
        Tom Lendacky <thomas.lendacky@....com>,
        David Rientjes <rientjes@...gle.com>,
        Sean Christopherson <seanjc@...gle.com>,
        linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH] x86/sev-es: Fix SEV-ES #VC handler for string port IO

Hi Borisslav,

My sincere apologies for it.
We actually tested the patch but I made a bad mistake while generating
the patch file to email.
I will send a PATCH V2 after testing the email version patch file from
the scratch.

Regards,
Wooky

On Fri, Jan 8, 2021 at 9:20 AM Borislav Petkov <bp@...en8.de> wrote:
>
> On Thu, Jan 07, 2021 at 06:51:07PM -0800, Hyunwook (Wooky) Baek wrote:
> > Don't assume dest/source buffers are userspace addresses when manually
> > copying data for string I/O or MOVS MMIO, as {get,put}_user() will fail
> > if handed a kernel address and ultimately lead to a kernel panic.
> >
> > Signed-off-by: Hyunwook (Wooky) Baek <baekhw@...gle.com>
> > Acked-by: David Rientjes <rientjes@...gle.com>
> > ---
> >  arch/x86/kernel/sev-es.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/arch/x86/kernel/sev-es.c b/arch/x86/kernel/sev-es.c
> > index 0bd1a0fc587e..812494d216ba 100644
> > --- a/arch/x86/kernel/sev-es.c
> > +++ b/arch/x86/kernel/sev-es.c
> > @@ -286,6 +286,12 @@ static enum es_result vc_write_mem(struct es_em_ctxt *ctxt,
> >       u16 d2;
> >       u8  d1;
> >
> > +     /* If instruction ran in kernel mode and the I/O buffer is in kernel space */
> > +     if (!user_mode(ctxt->regs) && !access_ok(s, size)) {
>                                                 ^^^
>
> Just by looking at this patch I know you haven't tested it before sending.
>
> :-(
>
> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ