Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2723198rdb; Fri, 22 Sep 2023 06:53:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5p1To8DJC14TMfIO3nyN4PxqSq+sBLw5Yx0aQhdu0HJ02RSU+0SmaZTCNRmQskW5FQxYo X-Received: by 2002:a05:6a00:181f:b0:690:3956:6ec6 with SMTP id y31-20020a056a00181f00b0069039566ec6mr9884031pfa.9.1695390823136; Fri, 22 Sep 2023 06:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695390823; cv=none; d=google.com; s=arc-20160816; b=IJWYv06e7D+oOVk0CN8KUC34jzRdPMtsz8AoWWNInf4/uW/iZfJuNYlwrE7n7MVWSX FcBjITg7QkcRH9+KJkZoHTgammtnpp/TmjFGWPCRaOxPKCm3Bi1zKaYMTTygOlWOcirn X5jmMyFafVTp6qwLY26fvIP4HQyWIaD2QO8rmht3XH0RUFvLBttAlNNMm7MNvAFdlEDE TxUmfK5OVndT4+iTiBARzgqQmLtC7J3WbqTpJwLFgStY3cv5lqS1OX13kxbkNTePvsSK 7g6R1Ob4KLOXWaVIg4Msa25EmrztO8CxSMTmjpo9NA9gkhOTMt1T0JVN9DaYC5ZaoiP5 eJPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=S7RCXKyYKMQLG3vGgkpBtCk+Iz1UrpCWLT6QAxSsNhA=; fh=wIHqZpOIuzcidDZ82yQbOZuyHJty7uvaWDEh/efoVzA=; b=rY8K8ixswQr7ceIrbUPD1oXXqOhnSxNDZgom76CpXUW2RxA+UUHoEQEKjwbfyGl6h7 r5z7T0bi4tH2CA28NZ3VJxssdr5QtQ4kkj8m8Nx7wivWdlbKQexJD4D3ucATOuFgM6om Swhqoe3/gkgukIXYTCZEJID6cTAQ+hSfq+5O3VZHJJT6F6tLJb3hH5vzoBhO/c9eSkFY EFvvS/DpjsyjuLDX4lufAzjhgd+dSsHbsEJvwUqSoUebfteFloSLQoa1CibSdKxdm95R TwhIEoDeoVoHyf27a6jc3tJFgAewuqnYPkvxQ/hGV6M9JIMnpnwDyk2APbylF7ujCRQx uEug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=pIdywBKG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id f19-20020a056a0022d300b00691016ba9bcsi4188736pfj.14.2023.09.22.06.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 06:53:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=pIdywBKG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 2E3F4837CF2E; Thu, 21 Sep 2023 22:32:10 -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 S231185AbjIVFb7 (ORCPT + 99 others); Fri, 22 Sep 2023 01:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjIVFbw (ORCPT ); Fri, 22 Sep 2023 01:31:52 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B20D195; Thu, 21 Sep 2023 22:31:45 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 013C7100004; Fri, 22 Sep 2023 08:31:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 013C7100004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1695360703; bh=S7RCXKyYKMQLG3vGgkpBtCk+Iz1UrpCWLT6QAxSsNhA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=pIdywBKGo7B4Fq1jhjxNKBdaLwnCj5rcu4DozHvq8ZdW1hMS94y4mAFA5Qgnhklk/ MJAT7C7c+1qSRILNxvlXXJj37EFNOWGxuxEOlHD3jdq1a/krX0K2vMve5woYsL4ASE iheW3JSFEGq6U2pQ3NDdTnoQCrwNZ2CskhDWTcCQnMGL/P+v7YrLRC3HFAnNjsJEuw L/9RTX1P59rubr7zm6RIl4xjXyzYAVbXUE380Nn8daP9NbS8X0g7IJVFVQzNqwgICD DPdlVw/rvC3gWFwSwqAotY9etWc9dhNhV5vuHy5ypknTURAQQ/W7jEcgegrbm7l7qv 9EcxqgnxCSN+Q== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Fri, 22 Sep 2023 08:31:42 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 22 Sep 2023 08:31:42 +0300 From: Arseniy Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman CC: , , , , , , Subject: [PATCH net-next v1 01/12] vsock: fix EPOLLERR set on non-empty error queue Date: Fri, 22 Sep 2023 08:24:17 +0300 Message-ID: <20230922052428.4005676-2-avkrasnov@salutedevices.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230922052428.4005676-1-avkrasnov@salutedevices.com> References: <20230922052428.4005676-1-avkrasnov@salutedevices.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180033 [Sep 21 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: avkrasnov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 534 534 808c2ea49f7195c68d40844e073217da4fa0d1e3, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;100.64.160.123:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/09/22 02:22:00 #21944311 X-KSMG-AntiVirus-Status: Clean, skipped 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,URIBL_BLOCKED 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]); Thu, 21 Sep 2023 22:32:10 -0700 (PDT) If socket's error queue is not empty, EPOLLERR must be set. Otherwise, reader of error queue won't detect data in it using EPOLLERR bit. Currently for AF_VSOCK this is reproducible only with MSG_ZEROCOPY, as this feature is the only user of an error queue of the socket. Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/af_vsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 013b65241b65..d841f4de33b0 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1030,7 +1030,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, poll_wait(file, sk_sleep(sk), wait); mask = 0; - if (sk->sk_err) + if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue)) /* Signify that there has been an error on this socket. */ mask |= EPOLLERR; -- 2.25.1