kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fuqian Huang <huangfq.daxian@gmail.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Sean Christopherson" <sean.j.christopherson@intel.com>,
	"Wanpeng Li" <wanpengli@tencent.com>,
	"Jim Mattson" <jmattson@google.com>,
	"Joerg Roedel" <joro@8bytes.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, kvm@vger.kernel.org,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] KVM: x86: work around leak of uninitialized stack contents
Date: Thu, 12 Sep 2019 20:02:20 +0800	[thread overview]
Message-ID: <CABXRUiR0YSANWukwij0LNaJK24CiRFy878TE1AqVDAa91R-edg@mail.gmail.com> (raw)
In-Reply-To: <87r24leqf4.fsf@vitty.brq.redhat.com>

Vitaly Kuznetsov <vkuznets@redhat.com> 於 2019年9月12日週四 下午6:53寫道:
>
> Fuqian Huang <huangfq.daxian@gmail.com> writes:
>
> > Vitaly Kuznetsov <vkuznets@redhat.com> 於 2019年9月12日週四 下午4:51寫道:
> >>
> >> Fuqian Huang <huangfq.daxian@gmail.com> writes:
> >>
> >> > Emulation of VMPTRST can incorrectly inject a page fault
> >> > when passed an operand that points to an MMIO address.
> >> > The page fault will use uninitialized kernel stack memory
> >> > as the CR2 and error code.
> >> >
> >> > The right behavior would be to abort the VM with a KVM_EXIT_INTERNAL_ERROR
> >> > exit to userspace;
> >>
> >> Hm, why so? KVM_EXIT_INTERNAL_ERROR is basically an error in KVM, this
> >> is not a proper reaction to a userspace-induced condition (or ever).
> >>
> >> I also looked at VMPTRST's description in Intel's manual and I can't
> >> find and explicit limitation like "this must be normal memory". We're
> >> just supposed to inject #PF "If a page fault occurs in accessing the
> >> memory destination operand."
> >>
> >> In case it seems to be too cumbersome to handle VMPTRST to MMIO and we
> >> think that nobody should be doing that I'd rather prefer injecting #GP.
> >>
> >> Please tell me what I'm missing :-)
> >
> > I found it during the code review, and it looks like the problem the
> > commit 353c0956a618 ("KVM: x86: work around leak of uninitialized
> > stack contents (CVE-2019-7222)")
> > mentions. So I fixed it in a similar way.
> >
>
> Oh, yes, I'm not against the fix at all, I was just wondering about why
> you think we need to kill the guest in this case.

I don't know what is the proper way to handle this case, I just initialize the
memory to avoid information leakage.
(Actually, I am not an expert on KVM's code)
I will be appreciated if the bug is fixed. :)

>
> --
> Vitaly

  reply	other threads:[~2019-09-12 12:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  4:18 [PATCH] KVM: x86: work around leak of uninitialized stack contents Fuqian Huang
2019-09-12  8:51 ` Vitaly Kuznetsov
2019-09-12  8:56   ` Fuqian Huang
2019-09-12 10:53     ` Vitaly Kuznetsov
2019-09-12 12:02       ` Fuqian Huang [this message]
2019-09-12 16:20   ` Jim Mattson
2019-09-12 16:44     ` Vitaly Kuznetsov
2019-09-12 21:20 ` Jim Mattson
2019-09-12 23:52   ` Sean Christopherson
2019-09-13  9:07     ` Paolo Bonzini

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=CABXRUiR0YSANWukwij0LNaJK24CiRFy878TE1AqVDAa91R-edg@mail.gmail.com \
    --to=huangfq.daxian@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --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;
as well as URLs for NNTP newsgroup(s).