aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-08-29 04:42:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-24 02:26:42 -0400
commit2e45354645f77e83fe3832f150acdcfeff45f44c (patch)
tree3fe57917616af7a7a1cdaef5cf0d23ff018ffd94 /drivers/misc
parent95e838c915edbdde366d111905245171ac99c2cc (diff)
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/vmw_vmci/vmci_datagram.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_datagram.c b/drivers/misc/vmw_vmci/vmci_datagram.c
index f3cdd904fe4d..822665245588 100644
--- a/drivers/misc/vmw_vmci/vmci_datagram.c
+++ b/drivers/misc/vmw_vmci/vmci_datagram.c
@@ -328,7 +328,8 @@ int vmci_datagram_dispatch(u32 context_id,
328 328
329 BUILD_BUG_ON(sizeof(struct vmci_datagram) != 24); 329 BUILD_BUG_ON(sizeof(struct vmci_datagram) != 24);
330 330
331 if (VMCI_DG_SIZE(dg) > VMCI_MAX_DG_SIZE) { 331 if (dg->payload_size > VMCI_MAX_DG_SIZE ||
332 VMCI_DG_SIZE(dg) > VMCI_MAX_DG_SIZE) {
332 pr_devel("Payload (size=%llu bytes) too big to send\n", 333 pr_devel("Payload (size=%llu bytes) too big to send\n",
333 (unsigned long long)dg->payload_size); 334 (unsigned long long)dg->payload_size);
334 return VMCI_ERROR_INVALID_ARGS; 335 return VMCI_ERROR_INVALID_ARGS;