Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645505

Re: [PATCH] KVM: X86: Fix read out-of-bounds vulnerability in kvm pio emulation

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] KVM: X86: Fix read out-of-bounds vulnerability in kvm pio emulation
Date 2017-05-19 12:40 +0200
Message-ID <tINu9-QO-15@gated-at.bofh.it> (permalink)
References <tIMHL-hj-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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:

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] KVM: X86: Fix read out-of-bounds vulnerability in kvm pio emulation Wanpeng Li <kernellwp@gmail.com> - 2017-05-19 11:50 +0200
  Re: [PATCH] KVM: X86: Fix read out-of-bounds vulnerability in kvm pio  emulation Paolo Bonzini <pbonzini@redhat.com> - 2017-05-19 12:40 +0200

csiph-web