lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4sBIPSJpnqW5suU@localhost.localdomain>
Date:   Sat, 3 Dec 2022 10:56:16 +0300
From:   Artem Chernyshev <artem.chernyshev@...-soft.ru>
To:     Vishnu Dasa <vdasa@...are.com>
Cc:     Bryan Tan <bryantan@...are.com>,
        Pv-drivers <Pv-drivers@...are.com>,
        Stefano Garzarella <sgarzare@...hat.com>,
        Jakub Kicinski <kuba@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Linux Virtualization <virtualization@...ts.linux-foundation.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "lvc-project@...uxtesting.org" <lvc-project@...uxtesting.org>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] net: vmw_vsock: vmci: Check memcpy_from_msg()

Hi,
On Sat, Dec 03, 2022 at 01:17:33AM +0000, Vishnu Dasa wrote:
> 
> 
> > On Dec 2, 2022, at 2:58 PM, Artem Chernyshev <artem.chernyshev@...-soft.ru> wrote:
> > 
> > We returns from vmci_transport_dgram_enqueue() with error
> > if memcpy goes wrong
> 
> Thanks for the patch.
> 
> Nit: could you please update the description?  Maybe something like -
> vmci_transport_dgram_enqueue() does not check the return value
> of memcpy_from_msg(). Return with an error if the memcpy 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@...-soft.ru>
> > ---
> > net/vmw_vsock/vmci_transport.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
> > index 842c94286d31..7994090e0314 100644
> > --- a/net/vmw_vsock/vmci_transport.c
> > +++ b/net/vmw_vsock/vmci_transport.c
> > @@ -1711,7 +1711,8 @@ static int vmci_transport_dgram_enqueue(
> > 	if (!dg)
> > 		return -ENOMEM;
> > 
> > -	memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len);
> > +	if (memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len))
> 
> Need to free dg using kfree() before returning.
> 
> > +		return -EFAULT;
> > 
> > 	dg->dst = vmci_make_handle(remote_addr->svm_cid,
> > 				   remote_addr->svm_port);
> > -- 
> > 2.30.3
> > 
> 

Thanks for review. I'll fix flaws in a patch ASAP

Artem

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ