From patchwork Fri Oct 28 20:56:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dexuan Cui X-Patchwork-Id: 13024302 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56CB4ECAAA1 for ; Fri, 28 Oct 2022 20:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbiJ1U55 (ORCPT ); Fri, 28 Oct 2022 16:57:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiJ1U5n (ORCPT ); Fri, 28 Oct 2022 16:57:43 -0400 Received: from na01-obe.outbound.protection.outlook.com (mail-eastusazon11021025.outbound.protection.outlook.com [52.101.52.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7C4C67061; Fri, 28 Oct 2022 13:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l0pbNul/QEHC7RX5pyWBB6bXJva1B2nR0uSZ+/Gzv1v1lcmUPMjgCMuqdCvJTLfVteNV6z+IBWuY+7A0p3Y5+pTZ5Cf4/YjbZLvvB86iY30s5isXh7u/kJGFN+V5MUWlfr9QF6H5QAK+cavuc9ns9EPSKx5GgdeL1qj7dZ4ZQD/DoGXvrwZYOaD8lxCKJgMwth8MZE+tYyQ+LoKUCHc3iXIIDfPYCpWznf1avu2jYzkNPZOW31JlUTqwsuUzxQcSemxV2z4KwDBJu0SYG/Dn9L4AXucqa35VsE4uYmWlKgBiWDfUxRTUAkgOfUN/T0ewNiLgM9hhbKOfMxdLmsFKvg== 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=EZThoebMZbhM4eHlZN+9VDH81cPFQo81k6w8AV9KlOs=; b=G4iSPzPhPbtmh8wUEnSoS8Xld5AzT2tas2SX787dzmxLBRcLzWpsv+54LmyLnIrQuGRBvRqDKLRVVKAU/ZtANu87kKbTEKzCf4WLML+MtigovGosJvmNbJbFktoKjlALo8rGkm3AALHONu7/chEvcbISrRSKadbnyHUy48fyk5IMF3h6LprM2knMz+jS2C3MxENKduA+VK66e5UiXn+hQVcHntsMoNLVXgw2ZHJJelvsXz8bzXR1NGXBvoi/KPXzQkKnT3cDpN6UzEfoKtAQTfHLSta5FiWaJa2cymXDJZjE6aPI3kemv1tK84M4f/fvUaMYQu5EP4VThsV6655opQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EZThoebMZbhM4eHlZN+9VDH81cPFQo81k6w8AV9KlOs=; b=ElkzgMMuf/1GF0CmD6vNg1/wqCrgLJERFMBelB+kKfq8U14478n/71s+zwphr+umoy6Ri5ba/f6Uxvtv+pQHztRYdw6/PnubpEExwJhQYoKRxDyY8/kVWvPDwyFT8jycJ4oIm7lruBbkdrJxIHM5epJTwvipp/4fE8KSVRcIMv8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from BL0PR2101MB1092.namprd21.prod.outlook.com (2603:10b6:207:30::23) by PH0PR21MB1912.namprd21.prod.outlook.com (2603:10b6:510:d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.9; Fri, 28 Oct 2022 20:57:31 +0000 Received: from BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::a746:e3bf:9f88:152f]) by BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::a746:e3bf:9f88:152f%8]) with mapi id 15.20.5791.010; Fri, 28 Oct 2022 20:57:31 +0000 From: Dexuan Cui To: sgarzare@redhat.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, arseny.krasnov@kaspersky.com, netdev@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, stephen@networkplumber.org, wei.liu@kernel.org, linux-hyperv@vger.kernel.org, Dexuan Cui Subject: [PATCH 1/2] vsock: remove the unused 'wait' in vsock_connectible_recvmsg() Date: Fri, 28 Oct 2022 13:56:45 -0700 Message-Id: <20221028205646.28084-2-decui@microsoft.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221028205646.28084-1-decui@microsoft.com> References: <20221028205646.28084-1-decui@microsoft.com> Reply-To: decui@microsoft.com X-ClientProxiedBy: MW4P223CA0022.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::27) To BL0PR2101MB1092.namprd21.prod.outlook.com (2603:10b6:207:30::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR2101MB1092:EE_|PH0PR21MB1912:EE_ X-MS-Office365-Filtering-Correlation-Id: d40166e8-f677-43e1-383a-08dab92707a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GvQtBA4HfMln2+/7fTiMuTXNR0sWS1iFu635AzLchWZDd4GCxTC0z+3CTXPD/NBrF81P9HEi9GzIhU+DdWKE60+r6Kth3+n0XTyIcCDRhUnhlbI9u9y2GE9YCS6ZuuHDtCvjMcUyR0nUFLSoiXTCyTv4Fd0vyAlPPPSHvwH0ymjHqA/IUveHtNoVMRFswnpXawsUxJfNTnYRkvfy8r/1UnFwLsgcHEkviIKt4YpFZJOxwGLi22qXBlnOHmchKyF/2ycH7Do2U4YBChxfkszBEVuX0ZpdWwGrp2FJ392nRrisWnICyU+TQ9sIFokqHeV+K032qA3sMIH7i2UFLzgUNZgw/uP4HcGRRTRE/TT+XYhtXTWhD4czkBW4dluEbg16DE+PlM2htyWkOLIvsLBN+feaqme6ovtKu3uOJlO6OaE4yestKPFGTFNwinXUpsymiJFz4LYnhQGljM+Nd8EtlDTb15Lp07HTbXu+dLOWLI8C9AKo8MDFNbfrQmgjIjwXqJ0UAYpTXzhGPPonJdMP9R1eXHRyc19RyRVeZ1DIJEFdTKteddtVSYhcVF2hMRC6cahrCE4oc1TSHUwBgUV0dQF726pWPtzO6cIezpsRHDHBGOdgjuDWi+GhceThCwJTecCTwI95hF7ivmsR3Jsb0KAb+SXC6tSkg1iwkJA/zui2crjTrAsmJVBoSmxeZOtG7g3/WuMuDQZuCIPNtVMHLEWPjFzqEPirrFaPF85LrmtTIB3rRZLG94nx8ZBVxCbM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR2101MB1092.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(39860400002)(376002)(346002)(366004)(451199015)(6666004)(107886003)(52116002)(6506007)(82950400001)(8676002)(4326008)(7416002)(2906002)(3450700001)(66556008)(5660300002)(82960400001)(38100700002)(1076003)(41300700001)(86362001)(6512007)(66476007)(66946007)(316002)(36756003)(2616005)(186003)(83380400001)(6486002)(10290500003)(4744005)(478600001)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-M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jl1TSESuOIC0jhgaqHdbNIL0z+fgdqZlBcBkOhOnQivGFTdJuKYE0mGXgT3MAnL60K/Zki8FYB74s2xNPvOm9ZCwbQzeeyaL4iu9k2GOP+mRp3QmI/aRThQ4Lws7S0pxv+T+WiObG9pubMgo1jyM1xDqt0P19KZ8UMdyZ+gJ3ueokx7PIgw2110OQ+WGFSBsIkH2lPQYnQobr5UYUv4eajGbg1a85xXx/Ewv5O8xzpS9j6HD+JgcHzSkeUNvteyFa86BPgIE+A8RmrdyEj/coYh8j1NouSRihbiSsnlAiwywaktopj7IyC7gk+UilkP7rEXu+1et8ZbwWj0CgFesOJdX+nCE+9ivCeMleLivm2SgZEw0AN1RdMEVtqZv3a+NUpMrj9hc8CBufUNyuArVDPI8vlgUwqY82xA2ITpA549QTbnsqorPUN3phE9Xf42upj9XcuQA64rnLQYO73tYYx1DBUNeoBHkx6jsAgk6uiGZrdLeBekUtDNLtV3UXbvL++5uUNH17cAjAASt8+48ntxBUp73qQ4/o1Tzh14Tp+Tc6J7aVb0w4W75MjWzHVZLWMJdDYjUBfhCLkjVZTThCo2rbChytyyGpqx X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: d40166e8-f677-43e1-383a-08dab92707a3 X-MS-Exchange-CrossTenant-AuthSource: BL0PR2101MB1092.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 20:57:31.3565 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TsiQdR/LfoAn4kT1sKjIKfDa9PGNVGk1wkX6vuVXOHWZI154hjOBG5nYEzMYYu9tr4oESMHXActN9u9XMOcbsA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR21MB1912 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Remove the unused variable introduced by 19c1b90e1979. Fixes: 19c1b90e1979 ("af_vsock: separate receive data loop") Signed-off-by: Dexuan Cui Reviewed-by: Stefano Garzarella --- net/vmw_vsock/af_vsock.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index ee418701cdee..d258fd43092e 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -2092,8 +2092,6 @@ vsock_connectible_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, const struct vsock_transport *transport; int err; - DEFINE_WAIT(wait); - sk = sock->sk; vsk = vsock_sk(sk); err = 0; From patchwork Fri Oct 28 20:56:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dexuan Cui X-Patchwork-Id: 13024303 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 253D5ECAAA1 for ; Fri, 28 Oct 2022 20:58:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbiJ1U6B (ORCPT ); Fri, 28 Oct 2022 16:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbiJ1U5n (ORCPT ); Fri, 28 Oct 2022 16:57:43 -0400 Received: from na01-obe.outbound.protection.outlook.com (mail-eastusazon11021025.outbound.protection.outlook.com [52.101.52.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E384522658C; Fri, 28 Oct 2022 13:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KnPJuftSLpFq39ySG1DYAxDLK/HBLVPY/OBI72c+UJ3SIIOuw0HcRvgnIWmLGN9av3+dmbWNCFo1ArLMBz3W9lVSxSsxsDgkps5501npMMP/evBB3buEPDsu9ebnjTi1CF14HO6qJf60tZkdLmK19PzZXuVfa6+q+oYANd3a0ZCmfcUA+KWHjvobz4rEeBD7znhg93ujqmYriyVFDgBV1l+ALZZXlxWOmneDxOhrvWSAfJekiQFZV/lHhmk+L/MKBZ+zLhkhKEK2xWEBM9BoDEt73ZaAsF/iuI2cAKRHuYWSgTlCHeIcGx/Xtznw9dtnoef/XiNqiXU2/6EFzX18Xg== 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=XIvsfBoUlx8X8o2tPgZOm7bAnD0kMXnofYnq8hjc5O8=; b=AfSxUCK07EGvKUf76IztI5DvNUg+7NHxrrIuUFXUJJlS4MUmoVSlmnMdcXqcw/BIiAGb1IF8RNup/sF5J0h2eUng3yMi6VQPwuf9PW/9L3DHVUkvyGyr4OyhOP9h5U9WB5JUtE3e55Y65pCKDGhfIt8LCuyW8pdeod7Bt+sQi5ditI77ONLwITITKjRLTESmRxNfYUq5yjmiUEiqwHaKp6fhJxz9E3CtpuVP0En80xHmNwZo/co2r4qr7nUx44MwFknPx3yzWA8tEaZqi1QPt9gjuJcn1Ry0fq2gg7vFU4mDtiOr1ufZ7YjFfbgrYSxSdkOCQCuEPomNvrQndLo9yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XIvsfBoUlx8X8o2tPgZOm7bAnD0kMXnofYnq8hjc5O8=; b=K57ipt7vTp5EXIUiuCp4NEBYk20MXVFHdNnXTpwazGuNeNL1zcMJeFL7aeMWNT0BIUYtr4v4MXtZJkyMsKaiS6eI9I125dd3c4JRsUmPCdYHs7wFfjVs0KaS4Uh7um8u6ppV51vhMlPSGqZpkHoWp/f+S5RDZllHLsAkF0PoKMg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from BL0PR2101MB1092.namprd21.prod.outlook.com (2603:10b6:207:30::23) by PH0PR21MB1912.namprd21.prod.outlook.com (2603:10b6:510:d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.9; Fri, 28 Oct 2022 20:57:33 +0000 Received: from BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::a746:e3bf:9f88:152f]) by BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::a746:e3bf:9f88:152f%8]) with mapi id 15.20.5791.010; Fri, 28 Oct 2022 20:57:32 +0000 From: Dexuan Cui To: sgarzare@redhat.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, arseny.krasnov@kaspersky.com, netdev@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, stephen@networkplumber.org, wei.liu@kernel.org, linux-hyperv@vger.kernel.org, Dexuan Cui Subject: [PATCH 2/2] vsock: fix possible infinite sleep in vsock_connectible_wait_data() Date: Fri, 28 Oct 2022 13:56:46 -0700 Message-Id: <20221028205646.28084-3-decui@microsoft.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221028205646.28084-1-decui@microsoft.com> References: <20221028205646.28084-1-decui@microsoft.com> Reply-To: decui@microsoft.com X-ClientProxiedBy: MW4P223CA0022.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::27) To BL0PR2101MB1092.namprd21.prod.outlook.com (2603:10b6:207:30::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR2101MB1092:EE_|PH0PR21MB1912:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f44e39b-cbcf-4d0c-1443-08dab927089e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j3kkpxTvHY/6v82qAvRaPkv5+G8SguZqPQ9fuPnFhe8mu7l+SIDzxdMd7W5Fie1PUF4K5irDFqiiXpXET5NsydHwxblgtIRQoS2Qk3um2UfcjLPXqThh1OTCjBK+ANiDQ0+qVUtZipHYepUMfmBgQdfxxo9c5jzZopTpX+ofMSmn/45p+EAf5617cVSQM/DPaSjUGGqa5QdXYK+z0CGCfXy9H74dr3FznqOW5gIhzSQWN14jVb9uaovViUOPCLXztzDhsKIMPVjGDQT1OwZLj9H9RO96+uJ4GEt6CtKOHebZBrdxBFMgQ3cUNMgiETui+ZbRSgXpTm0367Dy0JYoP8kcpWrznnDepGTAbsXmOIfSyBgsVLVv0yFwXj/1FyeHul1EAFQKYXijQCfOrDK++rxGyYf7WyQORzYPCdqPHxZKimGTjWHj/SEp13T67AZIAfmAdlhtbggC7Q7T6Mnkx1mVaunlOwvLsaKeo+RVN8AKu7BOadRmhbKruSZM/DBSka4lIKVpLo++BlBKgnOqluJnzyFs0tBODpRstKBh+bcAde7YumQ3sg8iXGzXPU16hESGV7uXE2f3v0CnUOLkbKVLd/kn0rMnu/vKlzCPj4EEjJ7tk0BcZXvw+tYnasocgBJ3/O4iz5Ca/V98QtxngLdRXv59Jm976ofx3nQeP4EZ6TDnEUz0RpVhqWkUFwx1bVB7tLJqMM5vRwThpl4sPvi9iXsSlLslw03/az+1xwCxqACARruxs7iQUJQfoMAI X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR2101MB1092.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(39860400002)(376002)(346002)(366004)(451199015)(6666004)(107886003)(52116002)(6506007)(82950400001)(8676002)(4326008)(7416002)(2906002)(3450700001)(66556008)(5660300002)(82960400001)(38100700002)(1076003)(41300700001)(86362001)(6512007)(66476007)(66946007)(316002)(36756003)(2616005)(186003)(83380400001)(6486002)(10290500003)(478600001)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QccOEw7B8D5KEOfi6PYCZoFhupOzIjLAx8lu0W/wLYQAGRY0kw2Wc7jOwBIAUI66JJmNHNE7gCUg2Jb4dnQgoOSw7c0nhh8HaJzfZCkE7p3/RSFIqVXyBnvAq7SDK0NNBSxUjNqXvCF4M1dq5bsLlitcSKLkJAH0qoOShZA2st7MPCSIsmFh81ApLOAKRH/BYV6PMpAodYpAPBDa2OpGNCr7rl4xX1PtSU5XH/bwMX5Sq7H2891Es8OsH/aO8JISno/Bo910zw3ZYinutbGguNAWA8A6mQ1JF/MmfXAl/+hMewifc6w35sTuF5YyfS7CV+UD6F1X9v0p+gOoKp1rQIYcYh3LWAYh5Wy5Osvr11dfc1h7xQ6G1m+nnaminM/1LfO3mgCJJbxQRM3vtSd+sPahU6H7W00/1EfjakJdIUOHScl4pCur+Tzxv7hvrdk1E85mlJSKgLO9q9R1pgCv0OwhL/45ZHsRrQM7KcB3JDFhjGvZEBF/dLc4qA3VzQ6wgkjmiAh1ubkSt+vKxLwmtf8Mn6Fk44Tk59TyPd3FjDuNS8Q/M7lOR3pUmYJYwxuBhGpm7W4Yy1tDm4zSbHdVzi7Z+7IY3awbT+5iyeoHWFeALR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-Network-Message-Id: 7f44e39b-cbcf-4d0c-1443-08dab927089e X-MS-Exchange-CrossTenant-AuthSource: BL0PR2101MB1092.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 20:57:32.8298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KXIh7+vDvT/H76kuCOuyg6ff0witgokUW8+10Xx14pntpux3bhrLwLbv4M8duJaXyGXeCeYEuxw/aeVKjCU4Qw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR21MB1912 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Currently vsock_connectible_has_data() may miss a wakeup operation between vsock_connectible_has_data() == 0 and the prepare_to_wait(). Fix the race by adding the process to the wait qeuue before checking vsock_connectible_has_data(). Fixes: b3f7fd54881b ("af_vsock: separate wait data loop") Signed-off-by: Dexuan Cui --- net/vmw_vsock/af_vsock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index d258fd43092e..03a6b5bc6ba7 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1905,8 +1905,11 @@ static int vsock_connectible_wait_data(struct sock *sk, err = 0; transport = vsk->transport; - while ((data = vsock_connectible_has_data(vsk)) == 0) { + while (1) { prepare_to_wait(sk_sleep(sk), wait, TASK_INTERRUPTIBLE); + data = vsock_connectible_has_data(vsk); + if (data != 0) + break; if (sk->sk_err != 0 || (sk->sk_shutdown & RCV_SHUTDOWN) || @@ -1937,6 +1940,8 @@ static int vsock_connectible_wait_data(struct sock *sk, err = -EAGAIN; break; } + + finish_wait(sk_sleep(sk), wait); } finish_wait(sk_sleep(sk), wait);