[lkml]   [2017]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] KVM: X86: Fix read out-of-bounds vulnerability in kvm pio emulation

On 19/05/2017 11:46, Wanpeng Li wrote:
> From: Wanpeng Li <>
> 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.



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

 \ /
  Last update: 2017-05-19 12:33    [W:0.066 / U:4.668 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site