Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e453546 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

VMCI: integer overflow in vmci_datagram_dispatch()



This is untrusted user data from vmci_host_do_send_datagram() so the
VMCI_DG_SIZE() macro can have an integer overflow.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 95e838c9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -328,7 +328,8 @@ int vmci_datagram_dispatch(u32 context_id,

	BUILD_BUG_ON(sizeof(struct vmci_datagram) != 24);

	if (VMCI_DG_SIZE(dg) > VMCI_MAX_DG_SIZE) {
	if (dg->payload_size > VMCI_MAX_DG_SIZE ||
	    VMCI_DG_SIZE(dg) > VMCI_MAX_DG_SIZE) {
		pr_devel("Payload (size=%llu bytes) too big to send\n",
			 (unsigned long long)dg->payload_size);
		return VMCI_ERROR_INVALID_ARGS;