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 <jhansen@vmware.com> Acked-by: Aditya Sarwade <asarwade@vmware.com> Signed-off-by: Andy King <acking@vmware.com> Reported-by: David Ramos <daramos@stanford.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
此提交包含在:
@@ -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,
|
||||
|
新增問題並參考
封鎖使用者