VMCI: Fix integer overflow in VMCI handle arrays
commit 1c2eb5b2 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:
Yang Yingliang <yangyingliang@huawei.com>
Showing
- drivers/misc/vmw_vmci/vmci_context.c 45 additions, 35 deletionsdrivers/misc/vmw_vmci/vmci_context.c
- drivers/misc/vmw_vmci/vmci_handle_array.c 25 additions, 13 deletionsdrivers/misc/vmw_vmci/vmci_handle_array.c
- drivers/misc/vmw_vmci/vmci_handle_array.h 19 additions, 10 deletionsdrivers/misc/vmw_vmci/vmci_handle_array.h
- include/linux/vmw_vmci_defs.h 10 additions, 1 deletioninclude/linux/vmw_vmci_defs.h
Please register or sign in to comment