From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=67.231.153.30 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796055728; b=Pfmp4AFdBY4/lBB1eqCJfmiDc1XXVJPhIq6N0RBOQRxIl3sPwfZqQ4yBcJdIYZDEivOT NgtjoIV8VtA8fxiemrm9FznrO62RNouBsRdWjxs27ohIgvrc1NkMx0TwulGf5lvWX+YEC oHMm2jbYiIdN5++6EIDI0h+XrDkKIga4+/ERSr2PMJYiE0BiWhEOkmql9X7OrZLZbR90S 9a1mtjyQ9+U/RepuwTNv5ig26XsV+31JFpnSPs83AeqPEKMrRbm+aLoqWW2Zw+Y72cez+ S2/AGCSkDB6Un6XFKedUCxdrar3II6kwYVF+umaL2v7WtQbCAZmFEyrqBilgJSJmtlg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796055728; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Date:From:To: CC:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To: X-Originating-IP:X-Proofpoint-Spam-Info:X-Proofpoint-ORIG-GUID: X-Proofpoint-GUID:X-Proofpoint-Spam-Details-Enc:X-Authority-Analysis: X-Proofpoint-Virus-Version; bh=x3yQhg+68gnVXAJ39y26xNJ4eZhoK8YFOqEs4dcEa2o=; b=r3+GQiFKCX3RRxj80xynCp/GtMXwY4YmIm3pc9+kj0Yiv7UrcrFqxnd01T8fAduOK9gA fc9dQktmPhvWXaaeI3x4vMu/uM+9qcYhNpqLXZ7NFbpXyy77uFkIyQNyszSNevt/jTOD+ l+iHV2ez2PdnAkiRmpNx+VVr7x23LIP+ufoB3Q5UzPqRW1mx8Tq71Yiz46YaT90cTP+U2 HHmUmdHFbaw0d/hBGE3HAlKt8qHzU2Lanad2gqM8PK9WgVhNzY7HwpVX5o6a00kXX4pH5 IgiubmkvID/en6hBb4NV49RfSJnIBFmpZa/K7TBlQBcQbiC0/rXHJh0leS7G1Tgo/Nw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=meta.com; spf=pass smtp.mailfrom=meta.com; dkim=pass header.d=meta.com header.i=@meta.com header.a=rsa-sha256 header.s=pps82601-s2048-2026-q3 header.b=WRPj1lQn; arc=none smtp.remote-ip=67.231.153.30 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) (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 BECFA606A31C; Mon, 30 Nov 2026 16:22:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BECFA606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=meta.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=meta.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com header.a=rsa-sha256 header.s=pps82601-s2048-2026-q3 header.b=WRPj1lQn Received: from pps.filterd (m0528005.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUG1RT64130594; Mon, 30 Nov 2026 08:21:51 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= pps82601-s2048-2026-q3; bh=x3yQhg+68gnVXAJ39y26xNJ4eZhoK8YFOqEs4 dcEa2o=; b=WRPj1lQnw7X4u8CS3AhNaK63A0K2gOhqlK8vXwZ2FRQp/I95WTat1 FqyRGZkqUU+f9uGMKaix78eBc41bCwvQ4Arz3JfLqmLnX8SowBPlRT5hUgKSbLC1 fGkskYovDyvUTPc5wMDNKkXS6NfMCIwK8wXekKiVutNfVJ4rgSbQdRrxy0QTQbLO HA22Kqv5imFnNs8VNGdPilYHfvzN7NeVBXtrwspNSipERzsmuNbmcpGYNEBauRnr ITLlYXF3POySkMdhayxEvUa9ZMG778iY3yrOEfVMgyQhNhw/8sDBEUfGNaQBMoF1 V5dE20aDo3nlAYxdhtNtt1HpPsMvTqEwg== Received: from maileast.thefacebook.com ([163.114.135.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 4j8hdnps08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 30 Nov 2026 08:21:51 -0800 (PST) Received: from localhost (2620:10d:c0a8:1b::8e35) by mail.thefacebook.com (2620:10d:c0a9:6f::237c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.56; Mon, 30 Nov 2026 16:21:50 +0000 Date: Mon, 30 Nov 2026 08:21:49 -0800 From: Bobby Eshleman To: Stefano Garzarella CC: Paolo Abeni , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , Eugenio =?iso-8859-1?Q?P=E9rez?= , Xuan Zhuo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Simon Horman , , , , Subject: Re: [PATCH net] vsock: only deliver taps to namespaces that can reach the device Message-ID: References: <20261116-vsock-tap-net-v1-1-7e24f45adad3@meta.com> <12a2b44d-3d24-4b77-9dd5-24361d5fe910@redhat.com> X-Mailing-List: kvm@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="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDA2NSBTYWx0ZWRfX96AZzt2Ryrtt UJV2QTaHrWrJYR4APyvvm+6a0opoPA3Xaj/avHZV/UWFfMndkFnjfS88J/8X3bn8Z6hugPrFjyD wCg7nAPB3KHF+xkSPUUulAWJhR6Mqro= X-Proofpoint-ORIG-GUID: vo6qV3yvIhYrcIvy7bEWZfJ5AznVInV8 X-Proofpoint-GUID: vo6qV3yvIhYrcIvy7bEWZfJ5AznVInV8 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDA2NSBTYWx0ZWRfX7LiZHp7H8MGz QlHMp+kCdJOjlAOvoNSraQPjuqNCamORLpmuvFo7nvroN8R8NUL9RLxfY/empGqPJ8zZLGGKzK6 H16osjTojMEas1cADXl5LKuvLmoYAykodZrl6katgIda1SLE3MAEbfZfVGifVGbYd7icephR29/ VpOzC042U/qFpuVToLLuQZ1L73y7YdGCScsxcb0Na9K/dUbrQXN3CDq5BmJ72+gHlB7iYtD3b2v 7t1FHmBX1vq6ztRU1WlacVo48UY7/WfoeNROjLMsqJxeonCXsheOmVzKjL+fQcObMJlIg7RJDEd riQQYZgziBimnOryubyDdzqqpfKusOcTf0D+1G+UJtefcDmydakOyOTYZWXScbPXKwIor6AynaG QtZDvBNjh6aGXJLXvPFTitqCWqiqElNJ59ux03VUgs1+0j+UXFLItNh78etU5hpV8z6ghM6/tom SeJDoTMDujCCtBvYnHg== X-Authority-Analysis: v=2.4 cv=PoQG/AM3 c=1 sm=1 tr=0 ts=6b0da29f cx=c_pps a=MfjaFnPeirRr97d5FC5oHw==:117 a=MfjaFnPeirRr97d5FC5oHw==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=7x6HtfJdh03M6CCDgxCd:22 a=jCddH8ec0KUNCymVuxII:22 a=20KFwNOVAAAA:8 a=Jax_4MWVcr7jocre7u4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_04,2026-11-30_01,2025-10-01_01 On Tue, Nov 24, 2026 at 09:43:46AM +0100, Stefano Garzarella wrote: > On Mon, Nov 23, 2026 at 08:18:47AM -0800, Bobby Eshleman wrote: > > On Mon, Nov 23, 2026 at 02:17:54PM +0100, Stefano Garzarella wrote: > > > On Mon, Nov 23, 2026 at 12:58:38PM +0100, Paolo Abeni wrote: > > > > On 11/23/26 10:43, Stefano Garzarella wrote: > > > > > On Mon, Nov 16, 2026 at 03:46:49PM -0800, Bobby Eshleman wrote: > > > > > > vsock_deliver_tap() clones every packet to every vsockmon device on the > > > > > > system. Creating one needs only CAP_NET_ADMIN in the owning user > > > > > > namespace, so an unprivileged user can capture the traffic of local mode > > > > > > namespaces. > > > > > > > > > > > > Pass the packet's netns to vsock_deliver_tap() and only deliver to > > > > > > devices that pass vsock_net_check_mode(), the same rule socket lookups > > > > > > use. vhost passes the vhost_vsock netns, loopback the sending socket's > > > > > > netns, and virtio-vsock NULL (global mode). > > > > > > > > > > For local namespaces I think we are fine, but what about global? > > > > > > > > > > Is it okay that a namespace with global can capture all the packets of other global namespaces? > > > > > > > > > > Asking because at this point the CAP_NET_ADMIN is useless, since an user on a global namespace, without CAP_NET_ADMIN, can just create a namespace to have CAP_NET_ADMIN and access all the traffic. Should we fix also that? > > > > My take is that the above question is quite orthogonal to the current patch > > > > and may impact old applications relying on the legacy behavior. > > > > > > True, but I'm not sure that behavior was correct since the beginning. > > > E.g., what is the point of having CAP_NET_ADMIN requirement if an > > > unprivileged user can just crate a new namespace and get it? > > > > > > Anyway, it's eventually pre-existing netns support in vsock, so it should be > > > fixed with a followup. > > > > > > > > > Reviewed-by: Stefano Garzarella > > > > > > Thanks, > > > Stefano > > > > > > > Its a fair point and I agree we should take it up in a follow up. My > > current instinct is that CAP_NET_ADMIN probably shouldn't be enforced > > for some (all?) of these global-mode paths. > > Why not? What I mean to say is we should probably only be doing those checks if it was required prior to all of the netns work to have cap net admin. I don't think we we were intending to change the permissions model for global namespaces... though without checking I'm not 100% confident yet which permissions a user would need to a) setup a vsock tap or b) read from it. I'll have to give it a deeper look. > > I should take a closer look at what’s going on with the NICs, what > permissions does someone intercepting traffic need to have? > > Ideally, even though the addressing is global, maybe we should set it up so > that within a namespace, you can only observe traffic generated by that > namespace or its children. > > But honestly, I don’t know how complicated that is. In fact, if you want > isolation, you have to enable “local,” and at that point, with this patch, > we’re all set. > > Thanks, > Stefano Let's consider it. Worth giving this all a second look. Best, Bobby