Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2694842ybp; Sat, 12 Oct 2019 15:42:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxj3FXoGvpqKRgMO++EPFKdE9RODtd7i9iCFSU+GiQBC6CidO6lQHpEpizS+K5Byb5GPz+2 X-Received: by 2002:a05:6402:550:: with SMTP id i16mr21295928edx.102.1570920140087; Sat, 12 Oct 2019 15:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570920140; cv=none; d=google.com; s=arc-20160816; b=waD6OycFftqdFhzPi6Vz2Vz9WgJ3PaZSY6/4GPbvVLTSsRfUzaCMvK0vGDQ/ZMX429 BMyM7X8V3TYyRNDO4ARe/3N2kuPyogMzhryx/GDllcgevtNOrxd4twl8j5b8qjtWXP2n Ym3FHCHGtGug734SZo+FyLIt3GQ/NpwV8eSvrDw4rVgcTFt8UYyjmDmHoGIeFF+ZgqA/ CVpvSr4bwbZoNhW91+GN/lFq8hEC32QHjFKtPGOjdm1LyhbnyCvq2jkqU31KhSE16Zu5 5NW6udV7LoTfe8OevPRp9BlrVXzJlqIVAvArOJ7+auIasmU/ofDPBL8NE2FLYHgZyQwt dqIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=S0RIwai/cYE64lyIc+A9F/PqKRzGBKYVkHbCBiipZNM=; b=FqyfQVQhI0EIRDMViY44giHQrhuYhsfhWB8wpA/ypstgdRLBI9ZXp0QW/IRckdLzkz YMJtHl8IqMcfJLQgxAZnujW+IsPGbLG8iLGBqxKgNbMy9bL90eICUc2BnOXhyGJyMFn/ Y39lI6M6+eZWZjPJwsqm21hlrUFe3RuRY1lYFXTc6PFKnnJrTbsdLI1xFUijCBZcK9KN mF9cRwrA3rmiMjr3c7C9FlHZuRRLDE+XNFSJz1tjqNpyQcoXjdNTOs9LDFgKxpMn3bi4 8AajpmhTEQzS/WDon7M0/kNcDWYT/MyQGmaomW1aVvmvE7aocoAlds15d3kQTaM9Mh6z 8HAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ck18si7987433ejb.300.2019.10.12.15.41.56; Sat, 12 Oct 2019 15:42:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727682AbfJLWiz (ORCPT + 99 others); Sat, 12 Oct 2019 18:38:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47790 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbfJLWiy (ORCPT ); Sat, 12 Oct 2019 18:38:54 -0400 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (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 8624EC049E10 for ; Sat, 12 Oct 2019 22:38:54 +0000 (UTC) Received: by mail-qk1-f199.google.com with SMTP id z128so12959159qke.8 for ; Sat, 12 Oct 2019 15:38:54 -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=S0RIwai/cYE64lyIc+A9F/PqKRzGBKYVkHbCBiipZNM=; b=iQRdWhCBOHX67K/i39O5TR24ljxoM7jx9X/zSjjjKU/ig4CSGvTC8Knb774W+73lbZ q3lDqSz9MwRtaTGJTHh+9sByGUiqht1xn9gzGU/Xa5glWi10WgzdiTeoGZNND/o1n7+e 89nPfChzY0oZvT2sagYMzf7dM7Mtg4s5RE6WmC2da7Us/bCxhdPIhBn8xBEX0geVxcz3 h+latuBf3mXeI+p2mAFKZUfqBXTPDBacxF29SH75bDbvyi4f76agnxKipCLLi+6yr7Le T8y4JXfvZdDx/KI+22aYJeka0Cv3v6PgycQYXy0mEMr5MydLZv0q0m8+HPU8zLF2dEj/ cWhQ== X-Gm-Message-State: APjAAAX3la6vLVADvbI/fxGIuHUxemVn7bs+XhnwEVX0vzJZ1G7ouM7o FKKYLBlVoPiVGbQzJC2VUM3mRypdF1kdyB6r6mbmFUwBPkoHdoj8y55sQgWs66dWobTtwFqC36v 4UQk8QEu+givFMuN5Ie5uEWay X-Received: by 2002:aed:25af:: with SMTP id x44mr24961936qtc.64.1570919933842; Sat, 12 Oct 2019 15:38:53 -0700 (PDT) X-Received: by 2002:aed:25af:: with SMTP id x44mr24961905qtc.64.1570919933558; Sat, 12 Oct 2019 15:38:53 -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 56sm11130495qty.15.2019.10.12.15.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2019 15:38:52 -0700 (PDT) Date: Sat, 12 Oct 2019 18:38:46 -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 0/2] vsock: don't allow half-closed socket in the host transports Message-ID: <20191012183838-mutt-send-email-mst@kernel.org> References: <20191011130758.22134-1-sgarzare@redhat.com> <20191011101408-mutt-send-email-mst@kernel.org> <20191011143457.4ujt3gg7oxco6gld@steredhat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191011143457.4ujt3gg7oxco6gld@steredhat> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 11, 2019 at 04:34:57PM +0200, Stefano Garzarella wrote: > On Fri, Oct 11, 2019 at 10:19:13AM -0400, Michael S. Tsirkin wrote: > > On Fri, Oct 11, 2019 at 03:07:56PM +0200, Stefano Garzarella wrote: > > > We are implementing a test suite for the VSOCK sockets and we discovered > > > that vmci_transport never allowed half-closed socket on the host side. > > > > > > As Jorgen explained [1] this is due to the implementation of VMCI. > > > > > > Since we want to have the same behaviour across all transports, this > > > series adds a section in the "Implementation notes" to exaplain this > > > behaviour, and changes the vhost_transport to behave the same way. > > > > > > [1] https://patchwork.ozlabs.org/cover/847998/#1831400 > > > > Half closed sockets are very useful, and lots of > > applications use tricks to swap a vsock for a tcp socket, > > which might as a result break. > > Got it! > > > > > If VMCI really cares it can implement an ioctl to > > allow applications to detect that half closed sockets aren't supported. > > > > It does not look like VMCI wants to bother (users do not read > > kernel implementation notes) so it does not really care. > > So why do we want to cripple other transports intentionally? > > The main reason is that we are developing the test suite and we noticed > the miss match. Since we want to make sure that applications behave in > the same way on different transports, we thought we would solve it that > way. > > But what you are saying (also in the reply of the patches) is actually > quite right. Not being publicized, applications do not expect this behavior, > so please discard this series. > > My problem during the tests, was trying to figure out if half-closed > sockets were supported or not, so as you say adding an IOCTL or maybe > better a getsockopt() could solve the problem. > > What do you think? > > Thanks, > Stefano Sure, why not.