Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1305574rda; Mon, 23 Oct 2023 08:36:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/K6GbPhw7ZVT0CV8exdJV5wwXgMiSPf0BJvQX3vApeJGUEBPeE//9DwCCCody5/BTKBIn X-Received: by 2002:a05:6e02:1a88:b0:357:d0d1:51c5 with SMTP id k8-20020a056e021a8800b00357d0d151c5mr5535509ilv.5.1698075415289; Mon, 23 Oct 2023 08:36:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698075415; cv=pass; d=google.com; s=arc-20160816; b=eSREva0+3Odv/m2ZLNhhLlKcN1wg3qaOCC1SXLfkHvBllf/jiDKJD8oui62+PvEQMO kBd+59smEU1A6S8jX3UkizYv65SMTnQAFF/Lq7J96MRItJ8a6elcxUHiM11dE9Clmpkb 0PrcLtcKmfSMyH/CSnWo2TIEPHXcXpJnaak+zvcdV2mrCspk5jvbzdTko2R0xGOE2MQm nLpfz3WGwLNRx8dFZCZi8FGGfpToEtCd7Qz6i2BoPRdwj0zwi+RkomZOYaqgFEKi6XhM lmA/bWWN7d5W3QHw58SbxDQkSHz1+vYQDHUeGspF3CU0oWu9RY4vpWRwfzdvHbmI4wk2 fFFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=b7Ux63l5Snv78cY/SS8EUlU0b7gStGDqIbcA/gNx1XM=; fh=d4k5w9b1sW/nokqbFsLprnUFYJwoew9Wd/GWw8a5s50=; b=x/yzNSK3dRSssZATIxC9Ti4l5qZ5hsMCK6IPb5o/LgbuduueT0c/j4sOECeNAZJTiF 7uejb5K9JJzz+G19y7y6TQeCRFbM21t+d9imDGzrigb1fscGN6pJ/njdNEH59hfw8AO7 LM4qvQt9ho4B51KS7ei7J5nNZTssARwQx/byuLi50Lt9H2bhYVEsp7TDxMG/3fr3YHcJ S7GjJSyw8+qAyLXEsG4zW9+z9LIBcpY2BDOuYqxoQoER0MD/78e/WHPZQ8RAQnlGhoUV z0fm79bgPnqoiAzFFFAR3A1xtTe9NdJjfAK1U/camsyN0Q5perP8aLYxElR2Sfic6uIb /SLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@uipath.com header.s=selector1 header.b=DTark9ha; arc=pass (i=1 spf=pass spfdomain=uipath.com dkim=pass dkdomain=uipath.com dmarc=pass fromdomain=uipath.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=uipath.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id v22-20020a63f216000000b0059f0cebd046si6420662pgh.729.2023.10.23.08.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 08:36:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@uipath.com header.s=selector1 header.b=DTark9ha; arc=pass (i=1 spf=pass spfdomain=uipath.com dkim=pass dkdomain=uipath.com dmarc=pass fromdomain=uipath.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=uipath.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B5462806293F; Mon, 23 Oct 2023 08:36:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjJWPgm (ORCPT + 99 others); Mon, 23 Oct 2023 11:36:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbjJWPgk (ORCPT ); Mon, 23 Oct 2023 11:36:40 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2099.outbound.protection.outlook.com [40.107.14.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A519D6E; Mon, 23 Oct 2023 08:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=creml0JKlWuyCaTGUZqJfhVIsZIJby80keC9VknvmJHT+BRUJNUduYVP3I9BEP7wdXjIs90mDvGm5njPtsSyWryDu9hos1ElqOJ75UlOL3PfuZDNtEOwlD4Gw5mzwyVe/aeaUx4+yP71q4vBPiyXwRHx97GGrWw/Qz3tbnBYdhJ6ROA9pmV5/keL1phCRgiAQOgrnMYmgveHx4Y/yB3R/H38Tm5KfwT2+ye09cnFEkXOoXbebPdMGoBiZl+EeugD4DRySoZg+4I9mOIgi7p6JKOTfTQOglbBJC9hSys4QdxKMZa7uboF71FcwKk5oOP/IwyZwEcuTQtZKInMAHQ6Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b7Ux63l5Snv78cY/SS8EUlU0b7gStGDqIbcA/gNx1XM=; b=OrmRIImtHtjU3eSvvGq8CRL/BAJkGhz6WRUxkfH3K5nE3H7txvfkTWTF4nHdE0EyIsfgDWWD133gQ7C8w9omvJ/zRTvHGdMxYt/YqDNWnjVNBB5TSYeFHwk/Y0SVr5h0H38tAnuibKnO4ZFpoD38GnggIes+lSnkuWacLGL1oWP0uUdXIRtw2Hl9a2o5ViYJNUkOsrKUVQlAWZ6+kkLsnoY9hPrio7r4H4dZopXxle1XOYnuGKb3owZiiwm7E+ISObPCsiSgWI3EkNCT2dutmAPO5mez0ZTT7szq+QsXHA15J1mdDMXWH5fXk9PN0EMiSBd6zlT55kmt+Dklt9/n6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uipath.com; dmarc=pass action=none header.from=uipath.com; dkim=pass header.d=uipath.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uipath.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b7Ux63l5Snv78cY/SS8EUlU0b7gStGDqIbcA/gNx1XM=; b=DTark9haZxL3rYYkKbZJGsZVIsSWqReD9Q4xn0I3avnguan5L2F4xrbzrx80OzgFoQ3J0kegVAH6euPWIFOPpaVCeNLoGpxdPiYEhQ9/GOBlLjayo6j8DxKLX8Gjl+h8qBpiar+ec2zeQLa9s39S4FI0XXQe1yeKNnQJJTrVX9QN2jD+YHN6x/yBlcssWUKuDIyQQcMEId+guXWNHqAIKCXXxfABXvnd0OC5fLDJih+8qzNzV92gLuaTDYMxDE78c0d8a71mC6A8U0bmipAfurMVRBxNpC+ADQugyO2fVPJZARC1PCd+xjwMEnN6lH7OiTNFmt8qMzJ15BomQZZP3A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=uipath.com; Received: from VI1PR02MB4527.eurprd02.prod.outlook.com (2603:10a6:803:b1::28) by PR3PR02MB6427.eurprd02.prod.outlook.com (2603:10a6:102:77::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29; Mon, 23 Oct 2023 15:36:33 +0000 Received: from VI1PR02MB4527.eurprd02.prod.outlook.com ([fe80::717d:6e0d:ec4b:7668]) by VI1PR02MB4527.eurprd02.prod.outlook.com ([fe80::717d:6e0d:ec4b:7668%6]) with mapi id 15.20.6907.030; Mon, 23 Oct 2023 15:36:33 +0000 Message-ID: <01ad7d00-9a53-445b-8916-3342047112a0@uipath.com> Date: Mon, 23 Oct 2023 18:36:21 +0300 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] vsock/virtio: initialize the_virtio_vsock before using VQs To: Stefano Garzarella Cc: Stefan Hajnoczi , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Mihai Petrisor , Viorel Canja , Alexandru Matei References: <20231023140833.11206-1-alexandru.matei@uipath.com> <2tc56vwgs5xwqzfqbv5vud346uzagwtygdhkngdt3wjqaslbmh@zauky5czyfkg> <0624137c-85cf-4086-8256-af2b8405f434@uipath.com> <632465d0-e04c-4e10-abb9-a740d6e3dc30@uipath.com> Content-Language: en-US From: Alexandru Matei In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: VI1PR0202CA0001.eurprd02.prod.outlook.com (2603:10a6:803:14::14) To VI1PR02MB4527.eurprd02.prod.outlook.com (2603:10a6:803:b1::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR02MB4527:EE_|PR3PR02MB6427:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bf37684-1fa0-498a-a07e-08dbd3ddd607 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ni9SySYE9ZOCiX79L5PPXtYn0DNOial75rQw7Sh3qpWKH4MwM4JwXjVn/fFfFqtzej/DHaRPUjE1q065WwMADYsnsI6uHCi5cY9Ryt6MtpJaqdHzTtdA7XlC9mc26hADyV4F6GPwQ/H7CbDmTNgqd9/qop1vZvccSBqbD0jc/59TxZTzHu6ksRe6kRCqFAXfuXPPw8yVYpX4D64R/KlE/jhLymss5yA+j4AfWE13plzx8lKsecu+35vjUgXVOO3ZIuApRDiPLifvR3GXJylY2b2DwXeY90fqwY6nfirOGtN28vz+HSEP4QD+xKC2OM3YP00WFqNo8tp/zujkSmPzTLmz4MbAh/BkMbcls8UnzaFo9KiJRcSX8R6vdMlKYrCczvuUBPnMkZjIUglEDbM7/K80Bw0YGwVJQwQSDspvYak+la+4kjELfiJNv5pPZ3hglpEM4HYxQfvEkmi1AoFQabsrrEQVTzRvQyJ0TuIH1jr9cymUhobvgGtS6gsAWHmp170JKFXktKCR2+EL0Y59eEc2abn0oeFfYa25Pdpogb3juWvFC2g/xI5uZ6fRmOOdj4wypn7zryRK1DB/DYE1blaQOKTB8OVbF8Q0byS1lkZoEgmkifO+X5rwIouEFFTMYOffe6OYV5jfAmYOJYAJWw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR02MB4527.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(346002)(136003)(376002)(396003)(39860400002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(26005)(31686004)(107886003)(38100700002)(2906002)(41300700001)(44832011)(86362001)(5660300002)(36756003)(7416002)(31696002)(4326008)(8676002)(8936002)(6916009)(2616005)(6666004)(478600001)(6506007)(316002)(66476007)(54906003)(66556008)(66946007)(6512007)(83380400001)(6486002)(53546011)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S3JIemt0KzdUUVVkK29rWGpKV1BMT1BROHJhcWNsMDRVUHVrQ1AycDI0aGNi?= =?utf-8?B?YlNtbmI3eEFJMEpTNjRVM2lxc05rS1BmWXN6SG5sMXJpNDNLV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ZUc5b1lkN2p4czdDTXJqa1RVQlVJWW02LzIyNjIybDI1K3lZ?= =?utf-8?B?cnhBdUVCS1hUclRxV2hwbGxGSjUyVEloc3pTN3VqZUxCbkl1bVFoeEEzQkpi?= =?utf-8?B?VUtFZU43ODlmcWdYVnJ3aFY2TWg0MWFmajVRSFlkWE9URUpGZ3RnTWNSRGt3?= =?utf-8?B?ZWl3ZTRMTFkzSmRTaUFRVmtPTHRzcXV3ODFsdWxoODcweVRpQVgreUc1V2xO?= =?utf-8?B?dnhzbktNcWNkNmhHWk05N1ZUbk9pMEZhYiszUjlaVnJ1cUJaRXlkMkxGZVFX?= =?utf-8?B?K3c9PQ==?= X-OriginatorOrg: uipath.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bf37684-1fa0-498a-a07e-08dbd3ddd607 X-MS-Exchange-CrossTenant-AuthSource: VI1PR02MB4527.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 15:36:33.6746 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d8353d2a-b153-4d17-8827-902c51f72357 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cnQFj2ZzGE4+EAvHRlAsX6DVrVqL80MCizZAvlPR2+GnJS2fPJkYEWqiwVlt41dVgNEwk/uVS1Hsr4WyPpYUmgmwQuqUyodyWOS5ghHsuQQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR02MB6427 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 08:36:53 -0700 (PDT) On 10/23/2023 6:13 PM, Stefano Garzarella wrote: > On Mon, Oct 23, 2023 at 05:59:45PM +0300, Alexandru Matei wrote: >> On 10/23/2023 5:52 PM, Alexandru Matei wrote: >>> On 10/23/2023 5:29 PM, Stefano Garzarella wrote: >>>> On Mon, Oct 23, 2023 at 05:08:33PM +0300, Alexandru Matei wrote: >>>>> Once VQs are filled with empty buffers and we kick the host, >>>>> it can send connection requests.  If 'the_virtio_vsock' is not >>>>> initialized before, replies are silently dropped and do not reach the host. >>>>> >>>>> Fixes: 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock") >>>>> Signed-off-by: Alexandru Matei >>>>> --- >>>>> v2: >>>>> - split virtio_vsock_vqs_init in vqs_init and vqs_fill and moved >>>>>  the_virtio_vsock initialization after vqs_init >>>>> >>>>> net/vmw_vsock/virtio_transport.c | 9 +++++++-- >>>>> 1 file changed, 7 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c >>>>> index e95df847176b..92738d1697c1 100644 >>>>> --- a/net/vmw_vsock/virtio_transport.c >>>>> +++ b/net/vmw_vsock/virtio_transport.c >>>>> @@ -559,6 +559,11 @@ static int virtio_vsock_vqs_init(struct virtio_vsock *vsock) >>>>>     vsock->tx_run = true; >>>>>     mutex_unlock(&vsock->tx_lock); >>>>> >>>>> +    return 0; >>>>> +} >>>>> + >>>>> +static void virtio_vsock_vqs_fill(struct virtio_vsock *vsock) >>>> >>>> What about renaming this function in virtio_vsock_vqs_start() and move also the setting of `tx_run` here? >>> >>> It works but in this case we also need to move rcu_assign_pointer in virtio_vsock_vqs_start(), >>> the assignment needs to be right after setting tx_run to true and before filling the VQs. > > Why? > > If `rx_run` is false, we shouldn't need to send replies to the host IIUC. > > If we need this instead, please add a comment in the code, but also in the commit, because it's not clear why. > We need rcu_assign_pointer after setting tx_run to true for connections that are initiated from the guest -> host. virtio_transport_connect() calls virtio_transport_send_pkt(). Once 'the_virtio_vsock' is initialized, virtio_transport_send_pkt() will queue the packet, but virtio_transport_send_pkt_work() will exit if tx_run is false. >>> >> >> And if we move rcu_assign_pointer then there is no need to split the function in two, >> We can move rcu_assign_pointer() directly inside virtio_vsock_vqs_init() after setting tx_run. > > Yep, this could be another option, but we need to change the name of that function in this case. > OK, how does virtio_vsock_vqs_setup() sound? > Stefano > >> >>>> >>>> Thanks, >>>> Stefano >>>> >>>>> +{ >>>>>     mutex_lock(&vsock->rx_lock); >>>>>     virtio_vsock_rx_fill(vsock); >>>>>     vsock->rx_run = true; >>>>> @@ -568,8 +573,6 @@ static int virtio_vsock_vqs_init(struct virtio_vsock *vsock) >>>>>     virtio_vsock_event_fill(vsock); >>>>>     vsock->event_run = true; >>>>>     mutex_unlock(&vsock->event_lock); >>>>> - >>>>> -    return 0; >>>>> } >>>>> >>>>> static void virtio_vsock_vqs_del(struct virtio_vsock *vsock) >>>>> @@ -664,6 +667,7 @@ static int virtio_vsock_probe(struct virtio_device *vdev) >>>>>         goto out; >>>>> >>>>>     rcu_assign_pointer(the_virtio_vsock, vsock); >>>>> +    virtio_vsock_vqs_fill(vsock); >>>>> >>>>>     mutex_unlock(&the_virtio_vsock_mutex); >>>>> >>>>> @@ -736,6 +740,7 @@ static int virtio_vsock_restore(struct virtio_device *vdev) >>>>>         goto out; >>>>> >>>>>     rcu_assign_pointer(the_virtio_vsock, vsock); >>>>> +    virtio_vsock_vqs_fill(vsock); >>>>> >>>>> out: >>>>>     mutex_unlock(&the_virtio_vsock_mutex); >>>>> --  >>>>> 2.34.1 >>>>> >>>> >> >