Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2074859rda; Tue, 24 Oct 2023 11:27:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYgpevcE1Ns69HLQ4tgC1T2l6/EVGd8fBWQVw67JD1cgqV6XyU2dotVfMajEGsRiCyIO1V X-Received: by 2002:a05:6a00:10c5:b0:68f:b5a3:5ec6 with SMTP id d5-20020a056a0010c500b0068fb5a35ec6mr16194555pfu.0.1698172050728; Tue, 24 Oct 2023 11:27:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698172050; cv=pass; d=google.com; s=arc-20160816; b=Tyz6V1anu20p7vr/6Kfh0zqUq27vpd6g2B7hZ4iWAR/X1uMYjydndb3NXTGa75ebGg KO9XLulkrXaxB1+7NGaO04o3ZUdrdLznpDDP9zkyNHlLPKV4E7NHNmSxN2TEcyAm4RaN Y1gTlFtDhzA8o4uoKezL7bOVmprUs7O9qI+voP6h0oPW6aR7F0Ol/7rdvE55/OahiAv7 +caATX+XkJ6snWhFNMnsQXtX96sA5o6luS5O9qk61Y3nfmDbc+2II+F4/YPfWw5LfSM5 n7abSldtunhEXIUkZ0NZbrq2Jna9s97SQsc+RFuNonBnHbBWzzMWw5iesNCWYE7hSm6a 4OaA== 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=fGuELi3XUY50mzSuATuWLj85HnwWO3fV7VGuJbAm+IU=; fh=d4k5w9b1sW/nokqbFsLprnUFYJwoew9Wd/GWw8a5s50=; b=RRBGCgPY4/8+djnXOykfkgThqSffI5pZk001f5xS8g5bT5uhOBNmRFMWvyLo/MtLWm V7iJ/VVoh4zKWmkIpAEwzFjvA2whWZUs1bohzBEhie9NxnFeEUpjpRfGSmn/34CjCH79 JgkkqFxiz4t3zf1i1Le8HLkChG5e+OA9cGRDyFmPoNOxduZXF9U6fi6hsYcbF201WDWD lfqpPoiCK0ZqAx3HUtYFdGHZYTVVBHbaeWPVBTaO8yEPFbCw0QmAojROpjJZXjA52S0X YhkT2Q/Or96BIepX3Bo3la3UNmk1zWZdMa6qNNqkG4Wc4P45Xb8/vtsTVCmSa3LbYoOI ZXBQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@uipath.com header.s=selector1 header.b=U5IHB+Rj; 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 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id x7-20020aa79a47000000b006be322191dasi8632774pfj.140.2023.10.24.11.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 11:27:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@uipath.com header.s=selector1 header.b=U5IHB+Rj; 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 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 16F43803DB76; Tue, 24 Oct 2023 11:27:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344117AbjJXS1P (ORCPT + 99 others); Tue, 24 Oct 2023 14:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343859AbjJXS1N (ORCPT ); Tue, 24 Oct 2023 14:27:13 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2118.outbound.protection.outlook.com [40.107.6.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EFD9123; Tue, 24 Oct 2023 11:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VMuVryeTXL7EWpgtmwmFxMzz+vWYWmxy4c3yN7E1Q9uMxqhN0lEvJWw58g67oRv5+JaeeolN3KV0e/gEGoFiqoLoj7U128Opz5DtYi/A2nPAOMaNUGDxU9RyGaSZwe1S1EEPqiQm6+OYIc6Kv9XH/vTahi2M+P1/8kdLOmfMwjtqwkAcG6iwk7/K8cLRVq9qq1knrMLRSX2kbDBmqpdaH8Z2c0/l9Ge2mzh6qz2V+evvvtV3iVKdfjkKELkraDPrqIJhBhrctgrSaXcF5BxW1v4YiApSxJx5v04uHoY30JviGyN2FFOsO6sw0hsz6sGArkP0xjPxlzwlcnoRq9g8fw== 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=fGuELi3XUY50mzSuATuWLj85HnwWO3fV7VGuJbAm+IU=; b=IrFEn6uwU60pMtpa/izvWbT/SEYCUr1fY3L/aGtAAH2vDx9J1Vp7KpWnhwdRR9bX/ld7BScMCwHAn82uLeLoRIhCrNdJGu9hIWb5GM1lS+yuLRKOarxUn8OcZQT0gxm48qmBA9mfFFyTmjBoTnGVOsmYawO6ByPTkoksL+oyYmURXsSYJkIusLFzybrgubZVkREUuN40D+mOX71LWi86euoWIkUhKDXrKhySjriNHar21fqdjoN96MF5W5ZbtOQdunrcUQTDchPHeF9Hbhbbh2FCRiFHsYxWuy2RzwFKjNqV2qVjs6tCFW9fN4Q/001vHB9XgLHdEb8PLl1v+ccxcA== 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=fGuELi3XUY50mzSuATuWLj85HnwWO3fV7VGuJbAm+IU=; b=U5IHB+RjZO7PL4otOE5Km/Gwruj+7lg7lGB2rExRoJMXD7efHaC/mBCsl46rmkaCq10/Uoa3BIkZ3dkSTCAs4HgBOyOTJmp2PabHE7ZSUEhTDgFefgEUpXYgqKTq37y8eUhUy69NJVRi/lMQjinjDbrZi2ykZ3dXhoG81QTE1HoCvh590Ehw0NgRX391BSLRNbVW5vV1wOYVeNTodnl3CnrP3x3PnbfJvxfVz4vWFMPPRJN9zYfBSWMlvU9Qh721HWqg8PSRGtCJ09DTdSLfrYfJsXG1TtSDdfGGL9/D8fzflT53n7jQFv3iuAsyMNV61DZqzR+phlo5Kp9oxXgzvA== 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 AS2PR02MB9488.eurprd02.prod.outlook.com (2603:10a6:20b:598::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Tue, 24 Oct 2023 18:27:07 +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; Tue, 24 Oct 2023 18:27:07 +0000 Message-ID: <674f7593-5421-4ecf-a0e0-2c46ab42a051@uipath.com> Date: Tue, 24 Oct 2023 21:27:00 +0300 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] 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: <20231023192207.1804-1-alexandru.matei@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: VI1PR10CA0101.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:28::30) To VI1PR02MB4527.eurprd02.prod.outlook.com (2603:10a6:803:b1::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR02MB4527:EE_|AS2PR02MB9488:EE_ X-MS-Office365-Filtering-Correlation-Id: c1131d7f-a67c-4a9c-0a19-08dbd4bed40a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0i6waNBqPxf3tKqLyx9VO9ZcAV1lP4ojABy426TLXftGN0etgEpdFzmdu2+wsrkJPAG2d8vIhypsnWVlXmoyjKrtwId00zLXDsTMbT7FEvPbtBEeWO7kxhm9979hKeZjvDg3fYbDBuapiJB99XEz3q44v0+IBngRHBIHE9ItTo8DOPYpxcaMgRX0ZGqnGtDTmfLnAmI9qaxASusnvLeHO6oakQnrwIRUcMopq4sKnMbmfJ9Bzi+YgwtVmZjplbEOZ0LB747HE2230xlv62SIli1FRj3JCbwOMt3G/FYYGWU/Dw33UzmZ6yAJvavUD3WsfWg0ePcUDeVgsOJ2q6SV6YdZaNi4cDbaKDWqal4gpjHiavSXIcpmJ3rMmXL0dxBwqUtE2+en3ncVOUjRa79GlFFFr9+CKoDFPOJgXLlKVCGfgSQ4yOGg7vtgNO2GKajO+SdRrx9NDX/GULDuSc2Dbih8i4x23sxESl/Fu6F9kS+IN00Lga20eSkXD0rvM1T5lO6Nxb0GDpkxiImXds8Z9npWMSKahzOpt1jcQ3GklrwNoSgDq9ZNUtq+aaAj60q2+PlDH5r0VY/YbLpDyVk7wjcidi/bYCS//YXq2leSOid0JsJAq9GD8XqmgDo+GB0X0ROhKmEuUN/6kseeXxU0RQ== 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)(136003)(346002)(376002)(396003)(366004)(39860400002)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(6512007)(107886003)(26005)(7416002)(6666004)(2616005)(6506007)(8936002)(53546011)(83380400001)(5660300002)(8676002)(4326008)(478600001)(44832011)(6486002)(2906002)(41300700001)(316002)(6916009)(66476007)(54906003)(66556008)(66946007)(31696002)(38100700002)(86362001)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SU1TMm5ZSlRWRjVSdHNtcmR3MkRCbU9tZ0tXSmtlS0s1VzBFaDUvVlZPRDJq?= =?utf-8?B?cDVmbnNZQzU5aGhxcHdnSDdRNDk4MTJrL0k3c1ZXOWtMa3dVT2xjYUpLbnBp?= =?utf-8?B?STlLNVAybVhqRlNvTmlTblpGU0VIMEJyOTZLSWVBbUhyaW1WMEZTMUgvNFFH?= =?utf-8?B?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cUdLbklNK3Z4NDk0UU5iaHpm?= =?utf-8?B?NXBmVWQzS2p5aXZQZTZWTzZZeDl2Y3lGa1dRNURJR1h3VG04M0FzdExYVlVp?= =?utf-8?B?ZG85bVJ6aWJpZm83anBRTnN3aVB4ZTkrbWQ4TDF1MlJTMmhvVHVOYlEyRUIz?= =?utf-8?B?Q3AwTG0zQTlaYzlQR0x3bXgweGNuMml6cEV4VWdHRHNpcDgwVUl3Ym5mMGRL?= =?utf-8?B?ZEE9PQ==?= X-OriginatorOrg: uipath.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1131d7f-a67c-4a9c-0a19-08dbd4bed40a X-MS-Exchange-CrossTenant-AuthSource: VI1PR02MB4527.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2023 18:27:07.1456 (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: SJxRuZJXhOAxQXZHI2eFetMt3PRPEnREK+uZKhffYlqRHyiIPVMatBDRxpOeizo6QhefGoMxb1XeHVbkGWaA5J6PJte16q7B32OYh0Hb/KA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR02MB9488 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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 24 Oct 2023 11:27:28 -0700 (PDT) On 10/24/2023 10:22 AM, Stefano Garzarella wrote: > On Mon, Oct 23, 2023 at 10:22:07PM +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. >> >> virtio_transport_send_pkt() can queue packets once the_virtio_vsock is >> set, but they won't be processed until vsock->tx_run is set to true. We >> queue vsock->send_pkt_work when initialization finishes to send those >> packets queued earlier. >> >> Fixes: 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock") >> Signed-off-by: Alexandru Matei >> --- >> v3: >> - renamed vqs_fill to vqs_start and moved tx_run initialization to it >> - queued send_pkt_work at the end of initialization to send packets queued earlier >> 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 | 13 +++++++++++-- >> 1 file changed, 11 insertions(+), 2 deletions(-) >> >> diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c >> index e95df847176b..c0333f9a8002 100644 >> --- a/net/vmw_vsock/virtio_transport.c >> +++ b/net/vmw_vsock/virtio_transport.c >> @@ -555,6 +555,11 @@ static int virtio_vsock_vqs_init(struct virtio_vsock *vsock) >> >>     virtio_device_ready(vdev); >> >> +    return 0; >> +} >> + >> +static void virtio_vsock_vqs_start(struct virtio_vsock *vsock) >> +{ >>     mutex_lock(&vsock->tx_lock); >>     vsock->tx_run = true; >>     mutex_unlock(&vsock->tx_lock); >> @@ -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,9 @@ static int virtio_vsock_probe(struct virtio_device *vdev) >>         goto out; >> >>     rcu_assign_pointer(the_virtio_vsock, vsock); >> +    virtio_vsock_vqs_start(vsock); >> + >> +    queue_work(virtio_vsock_workqueue, &vsock->send_pkt_work); > > I would move this call in virtio_vsock_vqs_start() adding also a comment on top, bringing back what you wrote in the commit. Something like this: > >         /* virtio_transport_send_pkt() can queue packets once >          * the_virtio_vsock is set, but they won't be processed until >          * vsock->tx_run is set to true. We queue vsock->send_pkt_work >          * when initialization finishes to send those packets queued >          * earlier. >          */ > > Just as a consideration, we don't need to queue the other workers (rx, event) because as long as we don't fill the queues with empty buffers, the host can't send us any notification. (We could add it in the comment if you want). > Thanks. Sure, I added it in the comment. > The rest LGTM! > > Thanks, > Stefano > >> >>     mutex_unlock(&the_virtio_vsock_mutex); >> >> @@ -736,6 +742,9 @@ static int virtio_vsock_restore(struct virtio_device *vdev) >>         goto out; >> >>     rcu_assign_pointer(the_virtio_vsock, vsock); >> +    virtio_vsock_vqs_start(vsock); >> + >> +    queue_work(virtio_vsock_workqueue, &vsock->send_pkt_work); >> >> out: >>     mutex_unlock(&the_virtio_vsock_mutex); >> --  >> 2.25.1 >> >