]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: coalesced_mmio: add bounds checking
authorMatt Delco <delco@chromium.org>
Mon, 16 Sep 2019 21:16:54 +0000 (14:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Sep 2019 05:18:14 +0000 (07:18 +0200)
commitad0ef1b06e7bd834060f62a4c24f5b88f714b01b
tree442e02eb2364e5a1e0aad6af8243fc7752da4ab2
parent0d84424bdfcd15e9ce01cfcd28e5c9e2a599f8db
KVM: coalesced_mmio: add bounds checking

commit b60fe990c6b07ef6d4df67bc0530c7c90a62623a upstream.

The first/last indexes are typically shared with a user app.
The app can change the 'last' index that the kernel uses
to store the next result.  This change sanity checks the index
before using it for writing to a potentially arbitrary address.

This fixes CVE-2019-14821.

Cc: stable@vger.kernel.org
Fixes: 5f94c1741bdc ("KVM: Add coalesced MMIO support (common part)")
Signed-off-by: Matt Delco <delco@chromium.org>
Signed-off-by: Jim Mattson <jmattson@google.com>
Reported-by: syzbot+983c866c3dd6efa3662a@syzkaller.appspotmail.com
[Use READ_ONCE. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virt/kvm/coalesced_mmio.c