提交 44aa5a6d 编写于 作者: A Artem Chernyshev 提交者: David S. Miller

net: vmw_vsock: vmci: Check memcpy_from_msg()

vmci_transport_dgram_enqueue() does not check the return value
of memcpy_from_msg().  If memcpy_from_msg() fails, it is possible that
uninitialized memory contents are sent unintentionally instead of user's
message in the datagram to the destination.  Return with an error if
memcpy_from_msg() fails.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 0f7db23a ("vmci_transport: switch ->enqeue_dgram, ->enqueue_stream and ->dequeue_stream to msghdr")
Signed-off-by: NArtem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: NStefano Garzarella <sgarzare@redhat.com>
Reviewed-by: NVishnu Dasa <vdasa@vmware.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 010b6761
......@@ -1711,7 +1711,11 @@ static int vmci_transport_dgram_enqueue(
if (!dg)
return -ENOMEM;
memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len);
err = memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len);
if (err) {
kfree(dg);
return err;
}
dg->dst = vmci_make_handle(remote_addr->svm_cid,
remote_addr->svm_port);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册