KVM: coalesced_mmio: add bounds checking
mainline inclusion from mainline-v5.3 commit b60fe990 category: 13690 bugzilla: NA CVE: CVE-2019-14821 ------------------------------------------------- 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: 5f94c174 ("KVM: Add coalesced MMIO support (common part)") Signed-off-by: NMatt Delco <delco@chromium.org> Signed-off-by: NJim Mattson <jmattson@google.com> Reported-by: syzbot+983c866c3dd6efa3662a@syzkaller.appspotmail.com [Use READ_ONCE. - Paolo] Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Conflicts: virt/kvm/coalesced_mmio.c [yyl: adjust context] Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录