Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4756581rwr; Sun, 23 Apr 2023 12:32:47 -0700 (PDT) X-Google-Smtp-Source: AKy350bRD7wlJChf3L8QISJ5G3TRJ30V0Q0R4MK5br1MIHs46Q8zdaJHRW5GKVoqKZVeXUYN+3CC X-Received: by 2002:a17:903:41d1:b0:19a:7f4b:3ef6 with SMTP id u17-20020a17090341d100b0019a7f4b3ef6mr16145280ple.3.1682278367191; Sun, 23 Apr 2023 12:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682278367; cv=none; d=google.com; s=arc-20160816; b=JhbC2n1mEVbX+Wput02jyRuBSIttHjWR8FPnq/DOwVtvx42BeapDKVKnjA9coh0Iw4 SmSVkMb93jyiB4nVHjXSaJkj+NWmGZM64BEz+IyGn8tq7V/r5ShIYFxdb+9Nee6UiH0G IV+stqSh/u4Q8KbfmTLlvkiB5fuKEPt/PLw+zSnwsmO4luRis72AkjKktJK0KWn1enxG Q2Ag6JvMgNrFm9F9d1JZIIfcvioWn9pgdjTsBfC7Ai/KSf46axaw7kpGVcWuar2c6JhR 0SJdvGyMqLXu40aCf4e8nkf0m7MZf6I3AMeO0T0SULPmus7DfKvbYrw0Ryj5/lby6Fzp HShw== 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; bh=dnEZbD4yrTqC14p1P2CFEotu3kmN6tK9cyCJAJm4wDc=; b=OwPofh+bKRRmhPLESFeni0o5YN1UEjdvxwdih9jLZ/iVkKpi+4492/uqGw+YUb+5nO mRaCGGhPot9AWSRualUu4yWu7ChoRCdaYKFIVi4SDwZQOuRHIQbdbSjFgsVwkQUq3TUL QbeoGd6eESHHD3FzK9qdMpvYwCBgdvql9X/E6vEuikJfH8Y/WMoIjsQLUDHKEaWEcnB1 /0Qtya5hZ8wnvlXz169T8mpEMjAMIpShz4jIMvdM/8SC8iA4SeUQAVAruHiXpdGB+5jO +p8hEoUVx9BvugNdg97ca7FrNjZoea5JRTSwZjHA90UPysScd+EU0qit63ygyhcTOFcU R+aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=jQXpFIwQ; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a170902db1100b001a920be271asi9999075plx.606.2023.04.23.12.32.33; Sun, 23 Apr 2023 12:32:47 -0700 (PDT) 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; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=jQXpFIwQ; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbjDWTb5 (ORCPT + 99 others); Sun, 23 Apr 2023 15:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjDWTb2 (ORCPT ); Sun, 23 Apr 2023 15:31:28 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80CEEE63; Sun, 23 Apr 2023 12:31:27 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 639DD5FD12; Sun, 23 Apr 2023 22:31:21 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682278281; bh=dnEZbD4yrTqC14p1P2CFEotu3kmN6tK9cyCJAJm4wDc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jQXpFIwQCXOjyCIt0VXPV/8YCiHqow3hUlSjenrDP5aaB6A1mjdXcGsk59qe3yNMX T5rBLrYzGhygTEOrYoXMDIKPuOwvWfHS4dZ2ToSzchl93UL+f1B9FSTZnCuVVzkdiB vhaXzmxFcz2Tu2I8yYF9jgRVNLLCt4In2FRE3eumShb36Fv1xIH350eI74YIJcbAKD 0lTJl1tUFSP1mX2lCeDyr6sz6H7NI23CV2ZpvsxGiWjlA2hXVC0Fg0HaVtdmQ8OYaz Tl9QjX6ADDmcvbFSSdQoUykRNNdZrSopwjpcvHNCGk/oK8q/6fozOimeI8dwbKh5UT Hp/Efnh/iaySg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Sun, 23 Apr 2023 22:31:21 +0300 (MSK) 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: , , , , , , , Arseniy Krasnov Subject: [RFC PATCH v2 07/15] vsock: read from socket's error queue Date: Sun, 23 Apr 2023 22:26:35 +0300 Message-ID: <20230423192643.1537470-8-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230423192643.1537470-1-AVKrasnov@sberdevices.ru> References: <20230423192643.1537470-1-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/23 16:01:00 #21150277 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 This adds handling of MSG_ERRQUEUE input flag for receive call, thus skb from socket's error queue is read. Signed-off-by: Arseniy Krasnov --- include/linux/socket.h | 1 + net/vmw_vsock/af_vsock.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/linux/socket.h b/include/linux/socket.h index 13c3a237b9c9..19a6f39fa014 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -379,6 +379,7 @@ struct ucred { #define SOL_MPTCP 284 #define SOL_MCTP 285 #define SOL_SMC 286 +#define SOL_VSOCK 287 /* IPX options */ #define IPX_TYPE 1 diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 137a0db6eaac..c50d2632a75f 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -110,6 +110,7 @@ #include #include #include +#include static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr); static void vsock_sk_destruct(struct sock *sk); @@ -2135,6 +2136,10 @@ vsock_connectible_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, int err; sk = sock->sk; + + if (unlikely(flags & MSG_ERRQUEUE)) + return sock_recv_errqueue(sk, msg, len, SOL_VSOCK, 0); + vsk = vsock_sk(sk); err = 0; -- 2.25.1