VMCI: integer overflow in vmci_datagram_dispatch()
Subsystems (3)
PATCH 1/1 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.
drivers/misc/vmw_vmci/vmci_datagram.c +2 -1
@@ -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 ;
Am 29.08.2014 10:42, schrieb Dan Carpenter:
Quoted 10 lines
This is untrusted user data from
vmci_host_do_send_datagram()so theVMCI_DG_SIZE()macro can have an integer overflow.Signed-off-by Dan Carpenter <[email protected]>drivers/misc/vmw_vmci/vmci_datagram.c +0
-0
drivers/misc/vmw_vmci/vmci_datagram.c int vmci_datagram_dispatch(u32 context_id, · line 335
Quoted 9 lines
drivers/misc/vmw_vmci/vmci_datagram.c +2
-1@@ -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 ;
Are your sure about that ">" ? maybe ">=" was intended ?
re,
wh
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 16 lines · walter harms
Am 29.08.2014 10:42, schrieb Dan Carpenter:
Quoted 13 lines
This is untrusted user data from
vmci_host_do_send_datagram()so theVMCI_DG_SIZE()macro can have an integer overflow.Signed-off-by Dan Carpenter <[email protected]>drivers/misc/vmw_vmci/vmci_datagram.c +0
-0@@ -328,7 +328,8 @@ int vmci_datagram_dispatch(u32 context_id,BUILD_BUG_ON (sizeof (struct vmci_datagram ) !=24 );
Quoted 8 lines
drivers/misc/vmw_vmci/vmci_datagram.c int vmci_datagram_dispatch(u32 context_id, · line 335
Quoted 6 lines
drivers/misc/vmw_vmci/vmci_datagram.c +2
-1-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 ;Are your sure about that ">" ? maybe ">=" was intended ?
Yes, I'm sure. As a rule of thumb, > is used for size comparisons and
Quoted 1 line
= is used for index comparisons.
regards,
dan carpenter