From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796235327; b=OKGKI01AJ7TbIXZ6mC/uoGdongRnPTj35jt0ee/yvfa/U97ecY/3hkj1N3CiRJJoesTy VNQU07z8h8Hfs88+9TDFW1w7LOHLc302p5Bhnk17ZVtq5f6J9fi0dSOGzcwyx+vfLxZyj 8kjiOry8hjql0HzDPee589hdBkKl3fvoBH5B4NPAqd/1u3ZZNMqODtD7WOIuFSHrpgwUC qSsKU/0fNLWSMYoxI2PClWj96tqRb1sfUpLXSLR3UdXxeb92GedbMlgb1f+IBGviATxIz 0t0U20Rdk/QYNcyXIEf3jBL08seJTI/bjTYIGoeTlYkQbQ6jJtEvkSSDcsE8KVEy4LA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796235327; h=DMARC-Filter:DKIM-Signature:X-MC-Rep:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:In-Reply-To:X-Mimecast-Spam-Score:X-Mimecast-MFC-PROC-ID: X-Mimecast-Originator:Content-Type:Content-Disposition; bh=xQrZic0oP2deQLOq4Lpl0nIWjZeG9bAA9scKYMX/7zg=; b=TSgqTtJQC6i2N6p1LGadVVsvkEouHrx7vCWP9G0Qad8k7km4xeB+aIWvIEqzIoOX3OHR K9rM+TKD5g7o2+jMreNnK8xvLMrmt2+CNpd3hWs1gl+nYE/j+ZZZthjX/LXz4Naxk2G4G TmC+bEdM8l92rievPJUjzVNQmbcsrRL8FGt8jO/c8jktvOEbb8gL/oXf2tcnEmZTqD8ef uN0Q+WGchCBRM8hzSXt0urwQrhvb9udMxdEAcjgktlBnrb6vP5UojchNSmUZSWAO/zfTS MKrV0SRfHlI/9wIRqMx2V4PBvWNYWnNJR5UxCy8Zo4YLsUEzN5MRW5rjqsEzLilttbg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GNHuiJei; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65261606A334 for ; Wed, 2 Dec 2026 18:15:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 65261606A334 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GNHuiJei DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796235326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xQrZic0oP2deQLOq4Lpl0nIWjZeG9bAA9scKYMX/7zg=; b=GNHuiJei016jMgmMBS4KF1UySktkjChn+z+bN092z1xyITBscJLKvObHRcqlbJWKhUFoMu XY4J4rSVUBkW/clD0Ya9ex648p86+CbQlHRhSpNXpD0VeDa4qkgPR1MuNhud63GwPAncDY eT9VZwrWx4pJoViF8nEDvnUVHZO0/+Y= X-MC-Rep: binary re single Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-283-6KEeW2oSMzWA9PEzJVsEdA-1; Wed, 2 Dec 2026 18:15:24 +0000 X-MC-Unique: 6KEeW2oSMzWA9PEzJVsEdA-1 X-Mimecast-MFC-AGG-ID: 6KEeW2oSMzWA9PEzJVsEdA_1796235323 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4bb8ae35aeaso110560745e9.3 for ; Wed, 02 Dec 2026 10:15:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796235323; x=1796840123; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=xQrZic0oP2deQLOq4Lpl0nIWjZeG9bAA9scKYMX/7zg=; b=0YjWkXRi5/owD65Xqlpw6Z8gTufiwAJsGeWFExDtHu60BnzhlOlLQ4pIOOP7C1FpEI 1bP5/TTYAU+gWgoNOgz+aHiLCro+JaafP99ZwAOpSytBYYucAaL42m+fmHFqZDbgdFJL GEwDKnK4BUbGQdmcDg4MvISyziAXyQZroOtT0VKMnB9xsFQWr9WxFVQI6m8Jd9zteKgj j27kgdgla4KmjS7yeJBEAd7F0PYR1UD8fFfYOl9QgheMJQK8CSj7q0DLC5rIE462F2nN dh4LsGKIcB9nWlQMOfk9wK74CHGxOt6Orcc9Nflcs6uuOrV7YnxuawwsSi8Tn7JOleyC JHHA== X-Forwarded-Encrypted: i=1; AL+hErE9629GfY1Fe7udHaXjbdiVsNB9rphZdmvkTf8um0Y5dcarZkcEQgA5Lb416cm0LXohFANoKBOZGegvHUfYhw==@lists.linux.dev X-Gm-Message-State: APuU4Z8XYTyfzDs6RM31MHCyMF5O67KrvL02lAJqWtprV4qjcc4tF90d zj1op1QNqXyKNpmdikPFZBssYE7bLpZgsy08o+SeWkY+Sb4EwlBUoSeIbGoLxnlqbUB84DNYyPW yeD4aBVuqW5ramanwzj6pB7Bwx08s3FakJEBY9l4wGL5yfuoVd18Av+ox70HOIC3i3tKa X-Gm-Gg: AZFdTZcVdJBaK5AYkX1/CPq6D1PmuD9XC0gWKks5nm321F++asg8GdCXaHwdZgxD2rV i5eWku1N2/9+bp6cWUVCExclyP8gy6wt4BmnKygufRv5ZDfjEmXU6Qe7Q3dFQ1cou+Ob47OTIFf LraXoLdmAJsyV/OgxSp7rMQxb56SBnIBWlLmWfpdXci8PTd+RTrzTMc5v5Bz8ckJZqDYgLr9Ojn ejzy8tyBBzrFA4XJ0QqFVzzWjJSrecNX4wPxSCz+Ps+nYM+xD8LmkgTq/XQzDeZ8Rkm85rQ/d3r a+eUxJw2TJwf06ieqQ0fA2RsP7+brOQMjPgq7uRHCLXhSL06ZGF68ynsvQQ2brXa76sJ46cPwxU Eiy6Ch3GYIM/zq/S2ZL/x9iNkpxwJacIX/cRDXFFezH9YES3oRt93SxQC/IaaaADUdgQQyp1jH6 cvyz5EmSPEPlTJvA== X-Received: by 2002:a05:600c:a09:b0:4a2:1a:a129 with SMTP id 5b1f17b1804b1-4bb88829115mr859954035e9.35.1796235323080; Wed, 02 Dec 2026 10:15:23 -0800 (PST) X-Received: by 2002:a05:600c:a09:b0:4a2:1a:a129 with SMTP id 5b1f17b1804b1-4bb88829115mr859953395e9.35.1796235322550; Wed, 02 Dec 2026 10:15:22 -0800 (PST) Received: from sgarzare-redhat (ip190-139-192-82.pool-bba.aruba.it. [82.192.139.190]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ceb834dfc5sm646625f8f.40.2026.12.02.10.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 10:15:20 -0800 (PST) Date: Wed, 2 Dec 2026 19:15:14 +0100 From: Stefano Garzarella To: Bobby Eshleman Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Shuah Khan , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?utf-8?B?UMOpcmV6?= , Shuah Khan , Randy Dunlap , Donald Hunter , Eric Dumazet , George Zhang , Andy King , Dmitry Torokhov , Willem de Bruijn , virtualization@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, sargun@sargun.me, jlinbox@meta.com, Bobby Eshleman Subject: Re: [PATCH net-next v8 0/7] vsock: assign the guest vsock device to a network namespace Message-ID: References: <20261130-vsock-guest-ns-v8-0-5fff852d325b@meta.com> X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 In-Reply-To: <20261130-vsock-guest-ns-v8-0-5fff852d325b@meta.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: TD-PPTouHbLy2uYre3gI4ASTUgGQNaxgn8GpRIxS2S0_1796235323 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Mon, Nov 30, 2026 at 05:06:48PM -0800, Bobby Eshleman wrote: >vsock network namespaces let a host put each VM in a namespace of its >own. A guest has no equivalent yet. It has a single G2H device that >cannot be assigned to a network namespace. > >This series lets a guest move that device into a network namespace. A >new generic netlink family, "vsock", supports the command >VSOCK_CMD_DEV_NETNS_SET which assigns the device to the namespace given >by fd or PID, or else to the namespace the request was sent from. The >namespace's existing ns_mode then decides who may use it: a "global" >namespace shares the device with every other global namespace, and a >"local" namespace keeps the host connection to itself. The device starts >out in the initial namespace, so until the command is issued global >namespaces see no change, and local namespaces still cannot use it. >There is no explicit unassign as assigning the device back to the >initial namespace is equivalent. > >The command requires CAP_NET_ADMIN in the initial user namespace, so >that an unprivileged user namespace cannot claim the device. > >Connections that can no longer reach the device after a move are reset, >so that a namespace which has lost access cannot keep using a socket it >opened while it still had access. They are reset the same way as when >the device is removed, so to the old namespace a move looks like an >unplug. The assignment holds a reference on the namespace, so deleting >that namespace does not move the device; only another assignment does. > >Because a move looks like an unplug, swept sockets share two known >issues with unplug and replug: connect() can fail with ECONNRESET and >leave the socket SS_CONNECTED, and shutdown() and credit updates can >still be sent once the device is reachable again. These will be >addressed in a separate series. > >A socket swept while connect() sleeps hits the same connect() vs reset >race as on unplug, which is fixed separately in net. This series builds >and applies without it: >https://lore.kernel.org/all/20261117-vsock-connect-close-v2-1-db5388323770@meta.com/ > >Transports opt in through a new netns_assign_allow flag. Only >virtio-vsock sets it here, because it is the only guest transport >that I am able to test against. > >Based off of Stefano's original series: >https://lore.kernel.org/all/20200116172428.311437-1-sgarzare@redhat.com/ > >Suggested-by: Stefano Garzarella >Link: https://lore.kernel.org/all/20200427142518.uwssa6dtasrp3bfc@steredhat/ >Signed-off-by: Bobby Eshleman >--- >Changes in v8: >- When the device moves to a netns that can no longer reach it, model > the behavior after a device unplug instead of a peer RST. This > simplifies the code by reusing vsock_for_each_connected_socket() and > dropping the lock_sock() sweep, vsock_g2h_assign_mutex and the > SOCK_DONE/peer_shutdown/TCP_CLOSING juggling >- Drop cancel_pkt() of swept sockets, so purged skbs no longer leave > vvs->bytes_unsent elevated (Sashiko) >- Swept sockets now behave as after an unplug: recv() returns -ENOTCONN > rather than EOF, and SIOCINQ may report bytes that recv() can no longer > read (fixing that requires recvmsg() to drain regardless of socket > state) >- Fix stale comments >- Rebased to latest net-next, the tap netns fix is now merged >- Link to v7: https://lore.kernel.org/r/20261117-vsock-guest-ns-v7-0-7e522ea9dd9b@meta.com > Aaaaa, I tried spending time today to review this, but I failed, sorry :-( FYI I'll be travelling till Dec 8, so on Dec 9 this will be my priority. Sorry about that! Stefano