VMCI: Check userland-provided datagram size
Subsystems (2)
PATCH 1/1 VMCI: Check userland-provided datagram size
Ensure that the size filled in by userland in the datagram header matches the size of the buffer passed down in the IOCTL. Note that we account for the size of the header itself in the check.
Acked-by Jorgen Hansen <[email protected]>
Acked-by Aditya Sarwade <[email protected]>
Signed-off-by Andy King <[email protected]>
Reported-by David Ramos <[email protected]>
--- drivers/misc/vmw_vmci/vmci_driver.c | 2 +- drivers/misc/vmw_vmci/vmci_host.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/misc/vmw_vmci/vmci_driver.c +1 -1
@@ -113,5 +113,5 @@ module_exit(vmci_drv_exit);MODULE_AUTHOR ("VMware, Inc." );MODULE_DESCRIPTION ("VMware Virtual Machine Communication Interface." ); -MODULE_VERSION ("1.1.1.0-k" ); +MODULE_VERSION ("1.1.2.0-k" );MODULE_LICENSE ("GPL v2" );
drivers/misc/vmw_vmci/vmci_host.c +6 -0
@@ -395,6 +395,12 @@ static int vmci_host_do_send_datagram(struct vmci_host_dev *vmci_host_dev,return -EFAULT ; } +if (VMCI_DG_SIZE (dg) != send_info.len) { +vmci_ioctl_err ("datagram size mismatch\n" ); +kfree (dg); +return -EINVAL ; + } + pr_devel("Datagram dst (handle=0x%x:0x%x) src (handle=0x%x:0x%x), payload (size=%llu bytes)\n", dg->dst.context, dg->dst.resource, dg->src.context, dg->src.resource,
Signature · 1 line
1.8.5.6