Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7024768rwb; Mon, 5 Dec 2022 23:21:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf5SWXjqTCsS48LJEbwBQAfK2f9VK849//IV3j3aujE7M4fj88LxbzhStBxCJjc+1ZWEajFV X-Received: by 2002:a62:5f81:0:b0:56b:bb06:7dd5 with SMTP id t123-20020a625f81000000b0056bbb067dd5mr69127376pfb.3.1670311276355; Mon, 05 Dec 2022 23:21:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670311276; cv=none; d=google.com; s=arc-20160816; b=eDn5ku8MK8VS+d/M738zixxutwr1xI5DlUs0KNpY0iA49tIA824FqmbqSUgMl8Qn0s eFALUOpsMxSvcJYFP0wGiIj7pZroIKu4Unw8YihG6GT7cCeuw94vCD5yfhW5oj/SRtP0 nOIlqsJg34iEnKHwca3jnY/q+FRHufMzorEiVBSbRj/O6iNbfrCqbLZfuBgKDQctoWEl 2F7h0VCsVP75IIKu8ij2aOygn/wot41t02vLNzjeWkiX/W3RSV1JCaj4UofLIgyEN5Qk LvwMQyxlmE9ylS1OXkjQnz2bdQZK1FUy6vNEweW4poJMxXkuUGzutsmddaxkuJIG644v It7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=vk1KwRP2HJzWSmb9mkWvmk8U5+2UHCcPHMgpx7eA588=; b=ZMm8e5tetqTwBAbA/qge8xmK28MHmjvauE2uwkouxWC5tDeAYNf8paHrqyTKUuexUR c+z++YWKXtx01x0WHVN23+dLc0ll5tDW2u4CkL0acyxTVlR5Ih19/DevW9V/EzFlWUoZ hSpCDVy0SF70OK9rK1GfYEC6xS5LgaGC6vP8y8nILgFrCxFTo2Fo6jraDWxGxtGJQ2fK 60+5VA95s9JlUc+Sd1KINRsMx1Mc5tYnoH+0cwDi76J0Gx0R+D0wspxqB6RCA7S710bq W3PqMHN8x91rFmxMfX/wv30wQmyawc2mxAL0llYWrVgKiGr9vhtCu2PN/DeKszN6pM93 xiIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p19-20020a170903249300b00188ad330242si15345253plw.131.2022.12.05.23.21.05; Mon, 05 Dec 2022 23:21:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234085AbiLFGwq (ORCPT + 79 others); Tue, 6 Dec 2022 01:52:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234002AbiLFGwm (ORCPT ); Tue, 6 Dec 2022 01:52:42 -0500 Received: from gw.red-soft.ru (red-soft.ru [188.246.186.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 329ACDE9; Mon, 5 Dec 2022 22:52:36 -0800 (PST) Received: from localhost.localdomain (unknown [10.81.81.211]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gw.red-soft.ru (Postfix) with ESMTPSA id 234473E1A0C; Tue, 6 Dec 2022 09:52:34 +0300 (MSK) Date: Tue, 6 Dec 2022 09:52:33 +0300 From: Artem Chernyshev To: Vishnu Dasa Cc: Stefano Garzarella , Pv-drivers , Bryan Tan , Jakub Kicinski , "linux-kernel@vger.kernel.org" , Linux Virtualization , "netdev@vger.kernel.org" , "lvc-project@linuxtesting.org" , "David S. Miller" Subject: Re: [PATCH v3] net: vmw_vsock: vmci: Check memcpy_from_msg() Message-ID: References: <20221205115200.2987942-1-artem.chernyshev@red-soft.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 173957 [Dec 06 2022] X-KLMS-AntiSpam-Version: 5.9.59.0 X-KLMS-AntiSpam-Envelope-From: artem.chernyshev@red-soft.ru X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Auth: dkim=none X-KLMS-AntiSpam-Info: LuaCore: 502 502 69dee8ef46717dd3cb3eeb129cb7cc8dab9e30f6, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;red-soft.ru:7.1.1;127.0.0.199:7.1.2 X-MS-Exchange-Organization-SCL: -1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, bases: 2022/12/06 06:02:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2022/12/05 16:38:00 #20652685 X-KLMS-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Dec 05, 2022 at 11:03:47PM +0000, Vishnu Dasa wrote: > > > On Dec 5, 2022, at 3:52 AM, Artem Chernyshev wrote: > > > > vmci_transport_dgram_enqueue() does not check the return value > > of memcpy_from_msg(). Return with an error if the memcpy fails. > > I think we can add some more information in the description. Sorry, I > should've said this earlier. > > 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 > > Thanks, Artem! This version looks good to me modulo my suggestion > about the description above. > > Reviewed-by: Vishnu Dasa > > Regards, > Vishnu > No problem, I'll change description in v4 Thanks, Artem