From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 8EC945A0269 for ; Thu, 03 Dec 2026 01:24:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796257443; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XFNZ3jVo8+gjhrNPNxgaXXVT7buEpKHi7MbTOWwdDBE=; b=OUJ3cdxoMvrC5sDMo4Os8rwCTswfGjokKzMUV3IMT0zFB/iyVuyHp1LsTUvprH2r+kM+3F efM86a5Hr5iouUuVclQI7dp+GFXsTqzAzYlDFfadFtbmZti5XGP/a7SXBtiRmTDbvG38M5 Ps7jayum9e/iruxqbXns+t2uCsd3YJc= X-MC-Rep: binary re single Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-iBmZm7VDMWKMd50y5aHfbw-1; Thu, 3 Dec 2026 00:24:02 +0000 X-MC-Unique: iBmZm7VDMWKMd50y5aHfbw-1 X-Mimecast-MFC-AGG-ID: iBmZm7VDMWKMd50y5aHfbw_1796257440 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-4925ef75fc4so8453450f8f.1 for ; Wed, 02 Dec 2026 16:24:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796257440; x=1796862240; h=date:content-transfer-encoding:content-type:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply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f:e00f:0:10b0:494:bf39:21a5 with SMTP id ffacd0b85a97d-4abb0e4716cmr59890363f8f.10.1796257440430; Wed, 02 Dec 2026 16:24:00 -0800 (PST) X-Received: by 2002:adf:e00f:0:10b0:494:bf39:21a5 with SMTP id ffacd0b85a97d-4abb0e4716cmr59890346f8f.10.1796257439919; Wed, 02 Dec 2026 16:23:59 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab658e2d1bsm82652306f8f.8.2026.12.02.16.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 16:23:59 -0800 (PST) From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH 0/2] udp: Don't share preserved source ports with foreign sockets Message-ID: <20261203012357.483a07b8@elisabeth> In-Reply-To: <20261201235202.2474521-1-jmaloy@redhat.com> References: <20261201235202.2474521-1-jmaloy@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Thu, 03 Dec 2026 01:23:58 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: b13jIw0qu-4cuZ_33gayqBBM6sJDw1q6Xw_lyIL7NmI_1796257440 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: AYKDKTY35NOFLR754JS6HO5BCRW4VP26 X-Message-ID-Hash: AYKDKTY35NOFLR754JS6HO5BCRW4VP26 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, Gerwim Feiken , Bug C X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 1 Dec 2026 18:52:00 -0500 Jon Maloy wrote: > For UDP flows initiated by the guest, we preserve the guest's source > port on the host. If another socket already holds that port, we either > fail to bind the flow socket, dropping the flow (e.g. with Podman's > rootlessport publishing the same port, bug 223), or, if that socket > also uses SO_REUSEADDR, end up sharing an identical 4-tuple with it, so > that replies get delivered to the wrong socket (e.g. several passt > instances in the same namespace talking to the same DNS resolver). > > Patch 1, by Gerwim Feiken, binds those flow sockets exclusively, and > falls back to a port picked by the kernel if the bind fails. > > Patch 2 keeps sharing the port if it's held by one of our own listening > sockets, so that we still preserve the source port for ports we > forward, which matters e.g. for BitTorrent's DHT. > > Tested in three ways: > * With a foreign socket holding the port (fallback, reply received) > * With pasta forwarding the port itself (port preserved) > * With two instances run by the same user using the same source > port (no stolen replies). > > Link: https://bugs.passt.top/show_bug.cgi?id=223 > > Gerwim Feiken (1): > udp: Don't share a preserved source port with other sockets > > Jon Maloy (1): > udp: Keep sharing source ports we forward ourselves Series applied, thanks, and welcome Gerwim to the git log! -- Stefano