From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F67DECE58C for ; Fri, 11 Oct 2019 14:22:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E77C206A1 for ; Fri, 11 Oct 2019 14:22:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728616AbfJKOWh (ORCPT ); Fri, 11 Oct 2019 10:22:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36580 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728414AbfJKOWh (ORCPT ); Fri, 11 Oct 2019 10:22:37 -0400 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CF94C01FBD9 for ; Fri, 11 Oct 2019 14:22:37 +0000 (UTC) Received: by mail-qk1-f200.google.com with SMTP id g65so9068008qkf.19 for ; Fri, 11 Oct 2019 07:22:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3/69IjnpthyAsYWKUyauhiINSOqY8C5ksx6fR2DlmR8=; b=cp1risq9kd9jVtJjJ3mxpBG0YyJ6umx8qa+ZMthSTCN39k2jzkHoV14wuuwZiM8Nek F6weQsnBsTQnJPi+H4yIuYPaVVuJ+0uWENBOQhNQ1ADT2NrN5l0p2MmYJSwaREVcAUNW fYYvfSGU37D+L8LzUXFgZw3Q1g1rZGM4g5U8QL1HDBQ0Si7ZBbbXm296y0r0JbVS0ZiE giAvuWKPw7K1uNhI8TItCPM3SG16sj20znPaPf0d6Xiim26vxLDC4xzOrFb5+S2mpJ8X BjnGhdsB6bc7C59FlKv032HF/yuBn/rwR+rFJwlROEV9xXQTzOaVtIp8BpUQgQXtnsA9 BVEg== X-Gm-Message-State: APjAAAX+1Xr/Ika450bmln8zKAXCnGcTD+oN/JCs1H+XuxZClh6xMmJg ewf6kqRpjrzCOQFo8dCjjv2ZpEXOtzHl90IrhO7CQwh1jRRNqkG9zfFwUKc4Qil4RlxqIQdrTOj z/hVA/1ZBvaN2uG3e X-Received: by 2002:ac8:6c4:: with SMTP id j4mr17178015qth.235.1570803756538; Fri, 11 Oct 2019 07:22:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyypmt8JVfwhZN2RwBVS/3yah5jYZ2+VyE0up3EqHheFxjCMjltd5zsKzuYpHN6h2SBGBQ1eg== X-Received: by 2002:ac8:6c4:: with SMTP id j4mr17177991qth.235.1570803756356; Fri, 11 Oct 2019 07:22:36 -0700 (PDT) Received: from redhat.com (bzq-79-176-10-77.red.bezeqint.net. [79.176.10.77]) by smtp.gmail.com with ESMTPSA id q47sm6531138qtq.95.2019.10.11.07.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 07:22:35 -0700 (PDT) Date: Fri, 11 Oct 2019 10:22:30 -0400 From: "Michael S. Tsirkin" To: Stefano Garzarella Cc: netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, Jorgen Hansen , "David S. Miller" , Stefan Hajnoczi , Adit Ranadive , Jason Wang , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 1/2] vsock: add half-closed socket details in the implementation notes Message-ID: <20191011101936-mutt-send-email-mst@kernel.org> References: <20191011130758.22134-1-sgarzare@redhat.com> <20191011130758.22134-2-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191011130758.22134-2-sgarzare@redhat.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Oct 11, 2019 at 03:07:57PM +0200, Stefano Garzarella wrote: > vmci_transport never allowed half-closed socket on the host side. > Since we want to have the same behaviour across all transports, we > add a section in the "Implementation notes". > > Cc: Jorgen Hansen > Cc: Adit Ranadive > Signed-off-by: Stefano Garzarella > --- > net/vmw_vsock/af_vsock.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c > index 2ab43b2bba31..27df57c2024b 100644 > --- a/net/vmw_vsock/af_vsock.c > +++ b/net/vmw_vsock/af_vsock.c > @@ -83,6 +83,10 @@ > * TCP_ESTABLISHED - connected > * TCP_CLOSING - disconnecting > * TCP_LISTEN - listening > + * > + * - Half-closed socket is supported only on the guest side. recv() on the host > + * side should return EOF when the guest closes a connection, also if some > + * data is still in the receive queue. > */ > > #include That's a great way to lose data in a way that's hard to debug. VMCI sockets connect to a hypervisor so there's tight control of what the hypervisor can do. But vhost vsocks connect to a fully fledged Linux, so you can't assume this is safe. And application authors do not read kernel source. > -- > 2.21.0