Patch "net: vmw_vsock: vmci: Check memcpy_from_msg()" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: vmw_vsock: vmci: Check memcpy_from_msg()

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-vmw_vsock-vmci-check-memcpy_from_msg.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ac080f0b2e6210fc471820a4c63872fe286fe353
Author: Artem Chernyshev <artem.chernyshev@xxxxxxxxxxx>
Date:   Tue Dec 6 09:58:34 2022 +0300

    net: vmw_vsock: vmci: Check memcpy_from_msg()
    
    [ Upstream commit 44aa5a6dba8283bfda28b1517af4de711c5652a4 ]
    
    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: 0f7db23a07af ("vmci_transport: switch ->enqeue_dgram, ->enqueue_stream and ->dequeue_stream to msghdr")
    Signed-off-by: Artem Chernyshev <artem.chernyshev@xxxxxxxxxxx>
    Reviewed-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>
    Reviewed-by: Vishnu Dasa <vdasa@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
index c1da1ce3d36e..da17b4c153b1 100644
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -1730,7 +1730,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);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux