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=1796235330; b=1NGvgmeuRv+TFwNqsX2f4wdQHtcwNoYAanyMSTcWPrjtcc8Iqqf2BfsMvnjwC2wMw14i taBPmLbBjtpL32LZp5qc1ei3jBewA6EYyuJnDpK4ik7jNAwl+O0o0qch8aiPUdKL50eN1 mMH9ToaViR4IKM4+pHQTeM/ezU1tyCPZdvYLSjI3RgltrvV+9KJWuPHX3OhKIwwPkhvKP lvxngkMlvIofAvqQJcTY7XCTwzH0g/q8CbZoFsnApa3HU+KRTCF4Y6Bb23JTW4fL+Rh0L DLECgFaAS/LWhNIEqk8X1ou6pRdrzOhWpeiPM+5bNlDGi1MZQnxSSg7AJKxUlwvJ8GQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796235330; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature: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:Content-Type:Content-Disposition:In-Reply-To; bh=xQrZic0oP2deQLOq4Lpl0nIWjZeG9bAA9scKYMX/7zg=; b=uTzy1vwXLd9hs2LSX7KK8Es6EugY2r18NnVaAVp+h7DTwIW3XCE4Fp8SSBLsEw2uPqMf YeQekiLNLsgWGNMmgrCvOzjTJRD0ht9Io+108K0WzD/7MtV6QRNWvkqMaReVywtY/36NX pjRynrTRjaMEFonbl0kR3PCVJKB+B8P8X6zDzf/gr6ewjpbgtDZGvoPJlXTrgXr4a64XD yDg4TyKL8kgigLSj+UVa0aiImaPl1PnTQThI0Am9+2UZ6o7e1G4XMVdCxDJcL1hmUVeHB d+77NuyKzOuQjd5L/LHArRMW7Fiaf8WroPTllYUM9ZLuXBhXlZq6ZJ4UEjkw0Solqdg== 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=dpNV3f64; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=TV4s11c2; 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 F01A9606A689 for ; Wed, 2 Dec 2026 18:15:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F01A9606A689 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=dpNV3f64; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=TV4s11c2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796235328; 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=dpNV3f64r50L6LxKFViZZTrepFwsOmfE36P66XFMAFpgqacFcfpFNQHYeZn2nVIfbTSIVg VW3uYC93YQ0oDXjyNbeZvPeSKBURzpHfFN8kckGFzkuXhXCMkZzCHpf7Z3JczlUMo6xkP5 SRTnZ0gho34AFFaFjqNyJJveXRQQ9QE= 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-397-N64kkRr1NnKq17gK_u1Llg-1; Wed, 2 Dec 2026 18:15:24 +0000 X-MC-Unique: N64kkRr1NnKq17gK_u1Llg-1 X-Mimecast-MFC-AGG-ID: N64kkRr1NnKq17gK_u1Llg_1796235323 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4bb8ae35aeaso110560725e9.3 for ; Wed, 02 Dec 2026 10:15:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796235323; x=1796840123; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=xQrZic0oP2deQLOq4Lpl0nIWjZeG9bAA9scKYMX/7zg=; b=TV4s11c2DW1h77mKoIYQvlOXhrsM8QaMt2YKhBd4Mg+DasQz8Ycyc2JOPgulBPH3Ww EcQMPScp4vDPAV0X65kDiVL8fbLgLCo/j6zAkhSAk7a4DQnsGzFLZ93FgeC/uWQ977va pxydi45W0wLVoBLsKlqIUnRTghxwK1PwwLWqc5rn01fXjDBbl38N7bqLMZK1hK29QvsR Zi/C61z3Mw3q4Ez8nRWYIy8ye6Z0IqAy1YPMC8NrC5rgGAfEmUVyWtHT3l1g2Ac6i8e6 nscO6shH5Pu+D0+nJVWiNGey14Te32k6VYv2Pf+eMM6EGYSA0JPXRMhjVE90GdJI5IfL pBKg== 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=ExVoNK6PxQ8VxBU3nwu0uZpJCTxBXg9wrdcb3q85ufjwMSzRFBiytTjwqUD4tGGG6p 1W+tL6D6pFqMiDX6hzC6Fl2/J6p/o4OI7onFQLWOBNviN97SI6I2wO4eCsWVlpTCwFZ7 CWWt2SYCvcEnQX0no8eodupvQbze4hmwlfkmVeuMOFwNj51xCyMdQrMrdmYKhLzBeNmL oyd8OjUXfQMPfJbMdIMQaH5HndNkdbMaUwa3TceXC0pJhFM0tDqkUKVPQ9ZArxStKPek 4kfv6ai4O7VaD3lrqzyt5brzooXE59UrkOYIoE8LB/d/GfbJJGwX5JmtJweS3T1rL72a 2sLw== X-Forwarded-Encrypted: i=1; AL+hErHV5JbpXokchdEaplQAC4cx+SAWJNS+cy2ny8qk3vItSuUe9OeuBeilS1d95bcJ8BxUwj4ovl4=@vger.kernel.org X-Gm-Message-State: APuU4Z9vS0VxWrvvoTfjxDgM/XCzZRyY3Thy8glolX98l4l9RpXZzbBK mfMnIVUUtLBjnfBWGQfihtg/iDGKtBgGbqYbgU5O7aZwJR4y+RMHJC7DfJmPoEJuGAP06aEskmV 0X00tJlw2irgFdbceL+R7Py1fufxIK9x6ofa5m0ac7UjqmXGINdBBQgZX2A== X-Gm-Gg: AZFdTZd0eWiDkzHP75VP9OxIKeaK2TN12pUsV4rSukLn7vF8RSjvsli7dlw3iV8PgK7 Se4H75xMqvewE6WSJcVKnGtpW8XLQHgobPfSbQr9gS7hgeQKQjxAFSCjrpKAXh4FT3NUhnLVA3I umC41bzndhMikTLtRgOj0n4oPuLI+uJ/weEhf3eQE++22iF3fO2Te2BMo2cP/w+0lCbKoImr3E/ t9XCcUm3jt2pmQlu9EVQy6KTGgGhkbJRolgI3wD/oVMSKyNrulznAGQQ3ULW3mbFX+Iq2atmJec LVtOObsJrXfkkO1FLh1yewJH7lKrmPaOXF05IlDzsPepJwEEeIRYEI3wQMLrYhfkXfwLXuAG7yD gbKL816Jf+m5sQB20VsWZRBfjcmpT01f5y2dPD8j7OeQB+jRitE7hmG9svFaCyMM9h/eeeLS26q l4mobCffSegm8Y4w== X-Received: by 2002:a05:600c:a09:b0:4a2:1a:a129 with SMTP id 5b1f17b1804b1-4bb88829115mr859953955e9.35.1796235323073; 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: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20261130-vsock-guest-ns-v8-0-5fff852d325b@meta.com> 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