public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] VMCI: integer overflow in vmci_datagram_dispatch()
@ 2014-08-29  8:42 Dan Carpenter
  2014-08-29 11:13 ` walter harms
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2014-08-29  8:42 UTC (permalink / raw)
  To: linux-kernel, George Zhang, Greg Kroah-Hartman; +Cc: kernel-janitors

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>

diff --git a/drivers/misc/vmw_vmci/vmci_datagram.c b/drivers/misc/vmw_vmci/vmci_datagram.c
index f3cdd90..8226652 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,
 
 	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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-29 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-29  8:42 [patch] VMCI: integer overflow in vmci_datagram_dispatch() Dan Carpenter
2014-08-29 11:13 ` walter harms
2014-08-29 11:21   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox