mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
	"Wanpeng Li" <wanpeng.li@hotmail.com>,
	Moguofang <moguofang@huawei.com>
Subject: Re: [PATCH] KVM: X86: Fix read out-of-bounds vulnerability in kvm pio emulation
Date: Fri, 19 May 2017 12:33:13 +0200	[thread overview]
Message-ID: <d3dc4ca8-0000-4cf6-b2b0-06bee400a8dd@redhat.com> (raw)
In-Reply-To: <1495187216-9294-1-git-send-email-wanpeng.li@hotmail.com>



On 19/05/2017 11:46, Wanpeng Li wrote:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
> 
> Huawei folks reported a read out-of-bounds vulnerability in kvm pio emulation.
> 
> - "inb" instruction to access PIT Mod/Command register (ioport 0x43, write only, 
>   a read should be ignored) in guest can get a random number.
> - "rep insb" instruction to access PIT register port 0x43 can control memcpy() 
>   in emulator_pio_in_emulated() to copy max 0x400 bytes but only read 1 bytes, 
>   which will disclose the unimportant kernel memory in host but no crash.

The data comes simply from the last PIO read, right?  The vcpu struct is
zero-initialized, so there is no kernel memory leak---the byte was
already previously known to the guest.

Good catch though, and the patch looks good.

Thanks,

Paolo

> The similar test program below can reproduce the read out-of-bounds vulnerability:

      reply	other threads:[~2017-05-19 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19  9:46 Wanpeng Li
2017-05-19 10:33 ` Paolo Bonzini [this message]

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=d3dc4ca8-0000-4cf6-b2b0-06bee400a8dd@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moguofang@huawei.com \
    --cc=rkrcmar@redhat.com \
    --cc=wanpeng.li@hotmail.com \
    /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

all inboxes | Powered by JetHome®