]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
VMCI: Fix integer overflow in VMCI handle arrays
authorVishnu DASA <vdasa@vmware.com>
Fri, 24 May 2019 15:13:10 +0000 (15:13 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit4aa9827e19aa1d47280d4e1e3650576231ddcea8
tree03c17ab047dd675a2c3425981f882be6397cc582
parent721136b064f2a826f0cfe10077d64f98503aa0e0
VMCI: Fix integer overflow in VMCI handle arrays

BugLink: https://bugs.launchpad.net/bugs/1839036
commit 1c2eb5b2853c9f513690ba6b71072d8eb65da16a upstream.

The VMCI handle array has an integer overflow in
vmci_handle_arr_append_entry when it tries to expand the array. This can be
triggered from a guest, since the doorbell link hypercall doesn't impose a
limit on the number of doorbell handles that a VM can create in the
hypervisor, and these handles are stored in a handle array.

In this change, we introduce a mandatory max capacity for handle
arrays/lists to avoid excessive memory usage.

Signed-off-by: Vishnu Dasa <vdasa@vmware.com>
Reviewed-by: Adit Ranadive <aditr@vmware.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/misc/vmw_vmci/vmci_context.c
drivers/misc/vmw_vmci/vmci_handle_array.c
drivers/misc/vmw_vmci/vmci_handle_array.h
include/linux/vmw_vmci_defs.h