]> git.baikalelectronics.ru Git - kernel.git/commit
VMCI: Enforce queuepair max size for IOCTL_VMCI_QUEUEPAIR_ALLOC
authorJorgen Hansen <jhansen@vmware.com>
Wed, 20 Jan 2021 16:33:40 +0000 (08:33 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jan 2021 18:18:50 +0000 (19:18 +0100)
commit58e3e4f43dd15cc9a469906a22670daf231070d6
tree0f27a2c7e71a620d9ba2f858454fb9126a301aec
parentd165c7ba8f3f45f8a722d3338bc6d97a4f2e5a40
VMCI: Enforce queuepair max size for IOCTL_VMCI_QUEUEPAIR_ALLOC

When create the VMCI queue pair tracking data structures on the host
side, the IOCTL for creating the VMCI queue pair didn't validate
the queue pair size parameters. This change adds checks for this.

This avoids a memory allocation issue in qp_host_alloc_queue, as
reported by nslusarek@gmx.net. The check in qp_host_alloc_queue
has also been updated to enforce the maximum queue pair size
as defined by VMCI_MAX_GUEST_QP_MEMORY.

The fix has been verified using sample code supplied by
nslusarek@gmx.net.

Reported-by: nslusarek@gmx.net
Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
Signed-off-by: Jorgen Hansen <jhansen@vmware.com>
Link: https://lore.kernel.org/r/1611160420-30573-1-git-send-email-jhansen@vmware.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/vmw_vmci/vmci_queue_pair.c
include/linux/vmw_vmci_defs.h